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 do we need singleton class?
What is scope & storage allocation of global and extern variables? Explain with an example
Is this valid in java ? Can we instantiate interface in java?
What are the skills required for core java?
Distinguish between a predicate and a function?
When a byte datatype is used?
What are variable names?
How do you check if two strings are equal in java?
Where local and global variables are stored?
Implement a stack with push (), pop() and min() in O(1) time.
How many bytes is a unicode character?
What is a condition in java?
What is the difference between normal report & matrix report?
What is collection class in java? List down its methods and interfaces.
What is package private scope in java?