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 immutable state?

508


Can you give names of Container classes?

1857


What is linked hashset and its features?

552


What is anti pattern in java?

520


What is the difference between double and float variables in java?

636






For class CFoo { }; what default methods will the compiler generate for you>?

620


What is difference between variable declaration and definition?

515


Can the interface be final?

580


What is string intern in java?

554


Describe string intern() methodology

596


How does predicate work in java?

539


How many inner classes can a class have?

580


What are format specifiers in java?

598


How do you use nextline in java?

504


Is java a compiler?

569