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
Is it better to learn java or python?
What is the use of rs next () in java?
What is transactional in java?
What is web xml java?
What is profile in java?
What is a java executable jar file?
What is jboss in java?
How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))
Why is class forname used in java?
What is jsr in java?
Define network programming?
How many types of jdk are there?
what is the package for freshers in valuelabs.
What is jndi datasource in java?
What is java lang noclassdeffounderror?