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

explain how java se 8 data and time api solves issues of old java date api?

894


I am trying to create a new universal user group. Why can't i? : java security

869


What is the meaning of loosely coupled in java?

826


What is a pojo class in java?

884


What is web container in java?

880


How do I download and install eclipse on windows 10?

782


What is lsdou? : java security

911


What is cdi in java?

831


Is jpa a framework?

800


What is java bean class?

841


When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?

872


Which method is used to create the daemon thread?

900


What is scrollable resultset in java?

852


What does jpa mean?

849


What is the difference between Logical Parallelism and Physical Parallelism?

3346