What is meant by constructor?

Answer Posted / shiva

java allows objects to initilize themselves when they are
created .this automatic initilization is done wih the use
of constructor .a constructor is a special type of method
that has the same name of its class.when ever an object of
class is created,its constructor will be invoked and it
will initilized the object.the return type for a
constructor is not defined as it implicitly takes its class
type as return type.

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between stringbuffer and string?

502


How to change the priority of thread or how to set the priority of thread?

624


What is an arraylist in java?

526


What is meant by data hiding/encapsulation?

579


What are parsing rules?

511






What carriage return means?

534


How can you avoid serialization in child class if the base class is implementing the serializable interface?

646


Is 64bit faster than 32 bit?

586


What are access specifiers available in java?

588


What is getclass () getname () in java?

683


What are thread groups?

580


What is meant by stack and queue?

610


What is role of void keyword in declaring functions?

580


Can an interface be final?

550


Explain the difference between serializable and externalizable in java?

547