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

What is Major and importance difference between for and foreach loop ?

1151


why Interface used?

988


Is null a keyword in java?

976


What is array size in java?

958


Can you override private or static method in java?

976


Where are the local variables stored?

1073


What is a singleton class in Java?

1064


What is class forname used for?

1051


Can we return null in java?

1152


How many digits is int32?

980


Explain purpose of sleep() method in java?

1120


What do you mean by JVM?

1080


Why is method overloading not possible by changing the return type in java?

1005


What are the differences between heap and stack memory in java?

1057


Which of the classes will have more memory allocated?

976