what is the use of a super keyword?

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


Please Help Members By Posting Answers For Below Questions

What is flatmap in java8?

477


Is java an api?

453


What is predicate in lambda expression?

459


What is the java virtual machine (jvm)?

584


Is openjdk the same as jdk?

478






How many types of jdk are there?

468


Which is better openjdk or oracle jdk?

432


Who developed rxjava?

461


What is dialect in java?

445


What is the use of flatmap?

501


What about products that claim to detect malicious applets? : java security

455


How do I open my java console?

483


Do I need both jdk and jre?

476


when i send the request to the JSP page it will print as it is and why? and how to solve this problem please inform me that solution

1419


What are orm tools in java?

573