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

Can you call a constructor within a constructor?

Answer Posted / amit kumar gupta

yes we can call by super() or this();

public abstract class Class1{

public Class1(){
System.out.println("Class1");
}
}

public class Class2 extends Class1{

public Class2(String Name){
System.out.println("Name = " + Name);
}

public Class2(){
this("AMIT"); // use only one this or super
super();
}
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you sort arraylist in descending order?

991


What is a flag variable?

925


What is binary search in java?

950


What is OOP's Terms with explanation?

1138


What is the use of arraylist in java?

1041


Should a main method be compulsorily declared in all java classes?

1014


What is difference between float and double?

925


What about static nested classes in java?

1088


What is the difference between and ?

959


What is a method in programming?

1143


Can we use synchronized block for primitives?

1022


Can java cast null?

988


What is a Transient Object?

1036


Why is stringbuffer thread safe?

1015


What is static synchronization?

1048