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?

Answers were Sorted based on User's Feedback



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

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

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

Answer / devarathnam c,kotagudibanda(po

Hi... Nothing will happen the compilet will supply the
default constructor of the class.Normally canostructor can
be used to instantiate an object.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / yamini

Constructor is used initialize certian paramameters to each
object on their creation.We can also overload
constructors.So we can initialize objects with diff params.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / ravikiran

constructor is used to initialize the variables during the
creation of instances.
If there is no constuctor no object will be gets created.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Core Java Interview Questions

Explain the term serialization?

10 Answers   Wipro,


when everything can be done by static block then why do we use main method?.

2 Answers  


What is a line separator in java?

0 Answers  


What is the ResourceBundle?

2 Answers   Elementus Technologies,


How do you make a thread in java?

0 Answers  


How many types of voids are there?

0 Answers  


without using arthematic operation ,how can you write the logic for adding/substraction/multiplication?

7 Answers   Tanla Solutions, Wipro,


what is the logic inside any default constuctor?

2 Answers  


Explain method overloading?

0 Answers  


How many bits is a char?

0 Answers  


What are the advantages of user defined functions?

0 Answers  


Can a double value be cast to a byte?

3 Answers  


Categories