Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the use of a super keyword?

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


Please Help Members By Posting Answers For Below Questions

Do I need to install jre if I have jdk?

935


I run a web server. Am I at risk? : java security

970


Which class is the superclass of every class?

1065


What is orm in java?

963


What is serializable in java?

900


How do I run a project in eclipse?

1014


What is the content reside in Use case Document?

2092


What is the difference between swing and awt components?

1161


What can open a jar file?

980


Which version of my browser should I use? : java security

1001


What about products that claim to block java applets at a firewall? : java security

994


What are the types of cookies in java?

1033


What is tuple2?

1005


What is the locale class?

997


What is savepoint in java?

912