Finalize()

class A
{ int i; int j;}
class B extends A
{ }
class C extends B
{ int k;}
class ABCDemo
{
public static void main(String[] args)
{
C c1 = new c();
c1.i = 11; c1.j=22;c1.k=33;
System.out.println(“Value of i in class c = “ + c1.i);
System.out.println(“Value of j in class c = “ + c1.j);
System.out.println(“Value of k in class c = “ + c1.k);
}
}
output is 11,22,33 in new lines as per SOP statement

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.