what is default constructor and parameterised constructor
with example?
Answer Posted / tushar
Default constructor: this constructor is created by the compiler automatically whenever an object is created.User don't have to write default constructor every class has its default constructor
Parameterized constructor: this constructor is exclusively written by the coder to assign the initial value to an instance variable.By creating parameterized constructor you can overwrite the default constructor.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is boolean data type in java?
What is the use of pattern in java?
What is starvation?
What are some characteristics of interference class?
What is a databasemetadata?
What are the common uses of "this" keyword in java ?
Write a java program to print fibonacci series?
Can you give few examples of final classes defined in java api?
what invokes a threads run() method? : Java thread
What does || mean in vectors?
What is the difference between overriding and overloading in OOPS.
Is it possible to specify multiple jndi names when deploying an ejb?
What is compareto () in java?
How to perform quicksort in java?
What is files manifesting?