Answer Posted / upasana das
example of inheritance using super keyword
class a
{
int x,y;
a(int i,int j)
{
x=i;
y=j;
System.out.println(" "+x+" "+y);
}
}
class b extends a
{
int g;
b(int i,int j)
{
super(i,j);
g=i+i*(j*j);
System.out.println(g);
}
}
class mab
{
public static void main(String args[])
{
b ob=new b(24,2);
}
}
output: 24 2
120
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the resourcebundle class?
How does java handle integer overflows and underflows?
Are jvm’s platform independent?
what is reflection api? How are they implemented?
What is the java api?
What is the first argument of the string array in main method?
What do you understand by casting in java language? What are the types of casting?
What if I write static public void instead of public static void?
What is the locale class?
Can we extract main method from another class?