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

Why generics are used in java?

1012


Why java is considered as platform independent?

985


What is void keyword?

1082


How to compare two strings in java program?

1038


Define an applet in java?

1132


What is a default constructor and also define copy contrucyor?

1089


How would you convert bytes to string?

965


Can we declare a constructor as final?

1285


When we should use serialization?

1003


What is the advantage of OOP in java?

1118


Explain when classnotfoundexception will be raised ?

1016


What is the common usage of serialization? What exceptions occur during serialization?

1096


What is the structure of java?

1008


what is ststic with example

2029


How do generics work in java?

1004