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

Explain role of constructor in a java application?

Answer Posted / sindhura

A constructor in java has the same name as that of the
class. Whenever the statement such as classname objectname
is encountered, it calls the constructor to initialise the
values for the object. It doesnot return anything and as
soon as the object is created constructor would be called.

ex. : if there is a class called A

A a = new A();
here A a statement would call the constructor immediately
to initialise the values for a object.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are advantages and disadvantages of OOPs?

1057


What is the difference between heap memory and stack memory?

1013


Difference between comparator and comparable in java?

1029


How many bits is a double?

944


What are data types in oop?

993


What is the use of :: in java?

957


Can we override static methods in java?

1012


Explain the difference between abstraction and encapsulation.

921


What is a java developer salary?

916


how come we know the object is no more used in the class?

6363


How many digits can a float hold?

941


How does map works in java?

941


Can a static method be overridden in java?

966


What is difference between final and immutable?

1076


What does int [] mean in java?

973