Answer Posted / onkdurga
constructor is a special type of member function,which has
the class name as function name.constructors doesn't have
any return type even void.constucter can be called
automatically at the time of object creation.Generally it
is used for initializing values to the data members.
constructorsare2types:1.default/parameterless
constructor
2.parametarized constructor
*costructor can not be inherited
*constructor can not be declared as static
*constructor can not be accessed outside of the class when
it is specified as private.
Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
What does %d do in java?
What is composition in java?
What does string [] args mean?
what is meant by HQL?
How many inner classes can a class have?
What is lifetime variable?
What are thread safe functions?
Explain about instanceof operator in java?
Is array passed by reference in java?
Explain parallel processing in java8?
How can we make string upper case or lower case?
Can we override private method?
What are the methods available in a class?
What is logical variable?
Which package is used for pattern matching with regular expressions?