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
What are the advantages of inner classes?
Does java linked list allow duplicates?
What is classpath?
When should we create our own custom exception classes?
Why do we use return statement?
What is an object in java and how is it created?
How do you add an element to a set in java?
What is the default size of arraylist in java?
How many arguments can a method have java?
What is the purpose of using break in each case of switch statement?
Explain all java features with real time examples
What is meant by singleton class?
Explain when classnotfoundexception will be raised ?
Is special character in java?
What is a condition in programming?