Answer Posted / swamireddy
the super keyword is used for accessing a base class
constructor values of the sub class.actually constructor
values are not inherited to the derived class.the super
keyword using inherited easily
for example:
import java.io.*;
class a
{
int x,y;
a(int i,int j)
{
x=i;
y=j;
System.out.ptintln(" "+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
48 4
Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
What are the rules regarding quotation marks?
How do I download and install eclipse on windows 10?
Is it correct to say that using parentheses can only change?
Describe the principles of oops.
What is java web application?
What about javascript? : java security
What is cache in java?
Why are lambda functions called lambda?
Do I need jdk or jre?
What is interceptor in java?
What is an api in java?
In an htm form i have a button which makes us to open another page in 15sec.how will you do that?
What is java ioc?
How do I find jre version?
What is a cookie in java?