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
Name primitive java types.
What is mime in java?
What is setstring method in java?
How can you work with permissions from your .net application? : java security
What is property file in java?
Do I really have to type in the programs in the book to try them out?
Can the main method be declared final?
Describe the principles of oops.
What is type inference? Is type inference available in older versions like java 7 and before 7 or it is available only in java se 8?
Explain daemon thread.
What are orm tools in java?
What is a static method?
What is jsr in java?
What is loose coupling in java?
When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?