Answer Posted / ranganathkini
Yes once constructor can call another constructor by using
the this() statement. Example:
class Account {
private double balance;
// 1st Constructor
public Account( double initBalance ) {
balance = initBalance;
}
// 2nd Constructor
public Account() {
this( 0.0 ); // call the 1st constructor
}
}
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
Which collection is sorted in java?
What is the difference between static class and normal class?
Can list be null in java?
Write a code to create a trigger to call a stored procedure
What is singleton class and how can we make a class singleton?
Is a boolean 1 bit?
What are the concepts of 'OOPS'?
What is string in java?
What is an example of procedure?
How many arguments can a method have java?
What is comparator in java?
What is the difference between Error, defect,fault, failure and mistake?
What is a substitution variable?
Define jit compiler?
What is treeset and treemap in java?