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

What is meant by constructor?

Answer Posted / bindhu

Constructor is special type of member function that will
automatically invoke when an object creates. The purpose of
constructor is for the initialization of instance
variables. A constructor having the same name as that of
class name. It may have arguments but doesn't return
anything.
If we want to initialize all objects of the same class
with same values, use default constructor.Otherwise, we can
use parameterized constructor if we want to initialize
objects of the same class with different values. If we
don't specify any constructor , compiler will use default
constructor with garbage value.

Is This Answer Correct ?    35 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a conditional equation?

969


Difference between operator overloading and function overloading

1011


What is the concept of multithreading?

921


What are design patterns and please explain?

1030


What are the advantages of passing this into a method instead of the current class object itself?

1616


What is the difference between class forname and new?

944


How an object is serialized in java?

930


Which is best ide for java?

994


Does treeset allow null in java?

906


Why does java not support pointers?

1007


Can we convert stringbuffer to string?

956


What is the symbol for line break?

1031


How many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?

1336


Can a class be private or protected in java?

998


How do I get the | symbol on my keyboard?

1018