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 meant by data hiding in java?
What is array initialization in java?
What is the difference between math floor and math round?
What is a nested class?
What is meant by local variable and instance variable?
Is arraylist sorted in java?
What is the benefit of inner classes in java?
What are the approaches that you will follow for making a program very efficient?
What is the role of the java.rmi.naming class?
Why we used vector class?
Explain different forms of polymorphism?
What is the point of java?
What is the final keyword?
I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in
How do you get length in java?