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
Is java free for commercial?
What is the difference between the reader/writer class hierarchy and the inputstream/outputstream class hierarchy in java programming?
Is nan false?
Why java is secure? Explain.
Write a program to check for a prime number in java?
What are the elements of java?
What is the difference between abstraction and encapsulation?
What is use of super keyword?
Can we override protected method in java?
What is http client in java?
Is a boolean 1 bit?
How variables are stored in memory?
Explain where variables are created in memory?
Which is illegal identifier in java?
What is append in java?