why constructor dont have returns type?

Answer Posted / sankar r k

The function of the constructor is to assign values to the
instance variable when the object is created for the first
time.The name of the constructor and the class name will be
same.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java oops?

697


Is alive method in java?

614


How to create a thread in java?

726


What are the advantages and disadvantages of object cloning?

684


What is meant by call by reference?

644






What is super?

712


What are keywords and reserved words in java?

707


Is hashmap thread safe?

675


What an i/o filter in java programming?

739


What is difference between word and integer?

740


Which is the best sorting technique in java?

658


What is the benefit of using enum to declare a constant?

778


What are the different types of garbage collectors in java?

688


What is class and object in java?

685


What is a buffer in java?

696