//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class F
{
int i;
F(int k)
{
i = 10;
System.out.println("F()");
}
public static void main(String[] args)
{
F f1 = new F();
System.out.println(fi.i);
}
}
7. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class G
{
G()
{
System.out.println("G()");
}
public static void main(String[] args)
{
G g1 = new G(90);
System.out.println("Done");
}
}
8. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class H
{
// Compiler will Provide default constructor
public static void main(String[] args)
{
H h1 = new H();
System.out.println("Done");
}
}
9. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class I
{
// Gives Error
public static void main(String[] args)
{
I i1 = new I(90);
System.out.println("Done");
}
}
10. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class J
{
J()
{
System.out.println("J()");
}
J(int i)
{
System.out.println("J(int)");
}
public static void main(String[] args)
{
J j1 = new J();
System.out.println("------");
J j2 = new J(50);
System.out.println("------");
J j3 = new J();
System.out.println("------");
J j4 = new J(100);
System.out.println("------");
}
}