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
explain how java se 8 data and time api solves issues of old java date api?
I am trying to create a new universal user group. Why can't i? : java security
What is the meaning of loosely coupled in java?
What is a pojo class in java?
What is web container in java?
How do I download and install eclipse on windows 10?
What is lsdou? : java security
What is cdi in java?
Is jpa a framework?
What is java bean class?
When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?
Which method is used to create the daemon thread?
What is scrollable resultset in java?
What does jpa mean?
What is the difference between Logical Parallelism and Physical Parallelism?