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

Is it better to learn java or python?

934


What is the use of rs next () in java?

900


What is transactional in java?

1027


What is web xml java?

882


What is profile in java?

909


What is a java executable jar file?

1018


What is jboss in java?

910


How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))

1721


Why is class forname used in java?

1065


What is jsr in java?

917


Define network programming?

1105


How many types of jdk are there?

1024


what is the package for freshers in valuelabs.

6161


What is jndi datasource in java?

892


What is java lang noclassdeffounderror?

911