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

why the constructor should be used in class,if there is no
constructor what will happen?

Answer Posted / bindhu

In Java, initialization of every object possible
by providing a constructor. If a class has a constructor,
Java automatically calls that constructor when an object is
created. So initialization is guaranteed.

If we don't define a constructor for a class, a default
parameterless constructor is automatically created by the
compiler.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is constructor inherited?

919


Is java 9 released?

951


Can we create constructor in abstract class ?

993


Difference between linkedlist and arraylist.

1025


What is off heap memory?

941


What is lexicographically smallest string?

1023


What is constant in programming?

1037


What are the main uses of this keyword?

1003


what r advatages of websphere? & how to deploy?

2112


What is generic type?

983


Difference difference paint() and paintcomponent()?

950


What is exception propagation?

1078


What is the purpose of the runtime class in java programming?

1015


What are the two ways in which thread can be created?

1009


What do you mean by stream pipelining in java 8?

1164