//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class I
{
I()
{
System.out.println("i()");
}
}
class J extends I
{
J()
{
System.out.println("j()");
}
}
class K
{
public static void main(String[] args)
{
I i1 = new I();
System.out.println("------");
J j2 = new J();
System.out.println("------");
}
}
2. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class L
{
L()
{
System.out.println("L()");
}
}
class M extends L
{
M()
{
System.out.println("M()");
}
}
class N extends M
{
N()
{
System.out.println("N()");
}
}
class O
{
public static void main(String[] args)
{
L l1 = new L();
System.out.println("------");
M m1 = new M();
System.out.println("------");
M n1 = new N();
System.out.println("------");
}
}
3. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class P{
P(){
System.out.println("P()");
}
}
class Q extends P{
Q(){
super();
System.out.println("Q()");
}
}
class R{
public static void main(String[] args){
Q q1 = new Q();
System.out.println("------");
P p1 = new P();
System.out.println("------");
}
}
4. Program
//Find what it gives Compiletion Error / Compiletion Successfully / Output ?
class V
{
V(int i)
{
System.out.println("V()");
}
}
class W extends V
{
W(int i)
{
System.out.println("R()");
}
public static void main(String[] args)
{
V v1 = new V(10);
System.out.println("------");
W w1 = new W(10);
System.out.println("------");
}
}