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, why the constructor is required in implemented
class?

Answer Posted / vimalan

constructor is used for initializing the class
variables.if constructor is not there,variables might be
taken the garbage values.To avoid garbage
values ,constructor is used.

Example:
Java:
int i;

initial value i=0;

C:
int v;
v=8823

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override constructor?

1018


Why are getters and setters used?

1058


What does singleton mean in java?

992


What are namespaces in java?

1027


Is void a data type in java?

981


What is the difference between a constructor and a method?

1239


What is a boolean expression in java?

1017


Why main method is static in java?

1169


What is a Hash Table? What are the advantages of using a hash table?

1080


What are thread safe functions?

944


What is a void method java?

952


What is parsing in grammar?

1040


How many times finalize method will be invoked? Who invokes finalize() method in java?

1014


What is getclass () getname () in java?

1140


What are the methods available in a class?

1074