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
Why scanner is used in java?
Why is java called java?
How are multiple inheritances done in Java?
how to open and edit XML file in Weblogic???
What is a singleton class? Give a practical example of its usage.
What is meant by design patterns?
What is multithreading in java?
What are variable arguments or varargs?
What is void class in java?
When should you use arraylist and when should you use linkedlist?
What is anti pattern in programming?
What are the actions that can occur when a thread enters blocked state?
Can two objects have same hashcode?
What does java stand for?
Which is bigger float or double?