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
v-model life cycle
Can we return null in java?
Where is singleton pattern used?
Write java program to reverse string without using api?
describe method overloading
How to avoid memory leak in java?
What is a Transient Object?
What is an example of a constant variable?
What is the synonym of string?
Can a main method be overloaded?
Why are pointers not secure?
Define a package.
What is the relationship difference the canvas class and the graphics class?
Can a method be static?
What is purpose of keyword void?