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
What is a method header?
How many java versions are there?
what is synchronization? : Java thread
What is the applet security manager, and what does it provide?
How arrays are stored in memory in java?
What is the use of math abs in java?
What does the append?
What is oop in java?
How do you create a method in java?
Why do we use return statement?
What is scope & storage allocation of global and extern variables? Explain with an example
How to implement a multithreaded applet?
Why constructor has no return type?
What is the difference between jvm and jre? What is an interface?
Can we override constructor?