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 a static class in java?
What is sortedset in java?
Explain java coding standards for methods?
What is an enumeration?
Give the hierarchy of inputstream and outputstream classes.
Is null a string in java?
Can set contain duplicates?
What’s the difference between unit, integration and functional testing?
Why is String immutable?
How do you sort a set in java?
What is the memory leak in java?
what is ststic with example
What is return keyword in java?
What is flush () in java?
What is incompatible types in java?