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 is the purpose of tostring() method in java?

1147


How is treeset implemented in java?

1021


What are filterstreams?

1070


Can we make main() thread as daemon?

1093


What is boolean used for?

1020


Variables used in a switch statement can be used with which datatypes?

995


Describe what happens when an object is created in java ?

998


Which sorting is best in java?

993


how to write a program for sending mails between client and server

2068


What is a boolean structure?

1079


What is files manifesting?

2197


What are the methods used to implement for the key object in the hash map?

1033


What is gc()?

1059


What is an object’s lock and which object’s have locks?

951


What are drawbacks of singleton class?

952