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?

Answers were Sorted based on User's Feedback



what is the use of a super keyword?..

Answer / sobhanadri.15

super keyword is used for accessing the variables in the
construtor of the subclass

Is This Answer Correct ?    5 Yes 1 No

what is the use of a super keyword?..

Answer / 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

what is the use of a super keyword?..

Answer / prem chawla

super keyword is refer to the parent class object it means
it can acc0ess all properties of the parent object

Is This Answer Correct ?    2 Yes 1 No

what is the use of a super keyword?..

Answer / 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

More Java Related AllOther Interview Questions

What is spliterator in java se 8?

0 Answers  


What is stateless object in java?

0 Answers  


What are the types of cookies in java?

0 Answers  


What is Map,List,hashtable,ArrayList and difference between them??

0 Answers   Cap Gemini, TCS,


What is jpa used for?

0 Answers  


What is a jpa repository?

0 Answers  


What is dto in java?

0 Answers  


What are tags in java?

0 Answers  


In a barber shop there are 2 doors. customer come in 1 door, leave in other. minimum # of chairs. barber spend his life in cutting. always barber can cut 1 customer. few chairs in the shop. if barber busy customer waits, if chairs full, customer leave. if no customer, barber sleeps. treat barber and customer as 2 threads. you can use Semaphore class with arrive and depart and count as parameter.

0 Answers   NCR,


What is the most important feature of java?

0 Answers  


What is meant by framework in java?

0 Answers  


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

0 Answers  


Categories