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 law?
Why is string builder not thread safe?
How to use Media tracker Class.
what is object-oriented programming in java?
How to print an arraylist in java?
What is parsing and its types?
What does replaceall do in java?
What is member in java?
Define an abstract class with reference to java.
How many digits is int32?
What is the history of java?
What is ctrl m character?
What does opcode mean?
What is Recursion Function?
Explain the importance of import keyword in java?