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
Can java arraylist hold different types?
What is stringwriter?
How strings are created in java?
Can a string be null?
What are the skills required for core java?
How can you set an applet’s height and width as a percentage?
What if I write static public void instead of public static void in java?
Why parameters should be passed by reference?
Why do we need hashset in java?
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
Can java cast null?
What is the purpose of checked and unchecked exceptions in JAVA?
How do you implement singleton class?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
Explain about transient variables in java?