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
Differentiate between static and non-static methods in java.
What is sorting algorithm in java?
What is the integer of 16?
Name some classes present in java.util.regex package.
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
What is the best way to findout the time/memory consuming process?
Write a program to print fibonacci series
How to instantiate member inner class?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
What are the states of thread in java?
Why strings in java are called as immutable?
Why does java not support pointers?
What is indexof in java?
Explain thread in java?
What is the purpose of stub and skeleton?