Answer Posted / sowjanya
constructor is special method with the basic initialization
information of the class variables.this constructor is
accessed at the time of object creation .from this object is
created with initial assignment values of variables. and we
can't call constructor separately.
if you have more than one constructor default constructor is
invoked at the object creation time and we can call other
constructor as we need .
constructor name is same as class name this is way to
identify methods is constructor.
methods are not invoked not default we call that as we
need.method name is not a class name.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is java built on c?
What is jndi datasource in java?
What are jpa repositories?
What is rxjava2?
How do I create an executable jar file?
What is interceptor in java?
When a thread is created and started, what is its initial state?
What are struts java?
What is an entity in java?
Can I have multiple main methods in the same class?
How can I swap two variables without using a third variable?
What is dependency injection in java?
I run a web server. Am I at risk? : java security
What is explicit casting?
What is dialect in java?