Answer Posted / qim2010
Yes, by using this() syntax. E.g.
public Pet(int id) {
this.id = id; // “this” means this object
}
public Pet (int id, String type) {
this(id); // calls constructor public Pet(int id)
this.type = type; // ”this” means this object
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Should a main method be compulsorily declared in all java classes?
What are exception handling keywords in java?
When we should use serialization?
Can you explain inner class.
What checkbox method allows you to tell if a checkbox is checked?
What are the Static and Dynamic Variables? Differentiate them.
Does java have a compiler?
Why is java so important?
When should you make a function static?
What do you understand by the term wrapper classes?
What is the use of private static?
Why are the destructors for base class and derived class called in reverse order when the program exits
What is a qms manual?
How do you override a private method in java?
What does sprintf mean?