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
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters?
What are assembly attributes?
How would you convert bytes to string?
Is linkedlist thread safe in java?
What is ctrl m character?
What is the use of math abs in java?
What is return null in java?
Why heap memory is called heap?
How do you remove spaces in java?
Why pass by reference is not possible in java?
what are different ways in which a thread can enter the waiting state? : Java thread
Explain the difference between throw and throws in java?
Can we assign integer value to char in java?
Explain about varargs in java?
What do you understand by a Static Variable?