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...

in a constructor what happen if u call super and this in
the same class? i know that it is not possible to call
both in the same one? if we call what will happen?

Answer Posted / atul

class A
{
public A()
{ super();//this is perfect no error
super();//but this call generate RunTimeException
//because inside constructor super called
//must be in first called ok thats it
}
public static void main(String args[])
{
A a1=new A();

}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the features of java?

1067


Is it possible to override the main method?

1039


What are the two main uses of volatile in Java?

1091


What is the default value of local and global variables?

1136


What does super keyword do?

1141


What is the difference between scrollbar and scrollpane?

1131


What is meant by stack and queue?

1124


In which order the iterator iterates over collection?

1026


What is the synchronized method modifier?

1277


What is sortedmap interface?

1050


What is the purpose of default constructor?

1035


Can a class be protected in java?

1010


Can we make a constructor final?

1081


What are advantages and disadvantages of OOPs?

1194


What is passed by reference and pass by value ?

1082