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 do you understand by synchronization?
Write a java program to count the number of words present in a string?
Why are there no global variables in java?
Can a private method of a superclass be declared within a subclass?
What is a void in java?
What is the java project architecture?
What are the different types of constructor?
Can a singleton class be inherited?
What is qualitative variable?
Why is java so popular?
Using callable statement how can you pass out parameters, explain with example?
What is the difference between keyword and identifier?
What is == mean?
Can classes declared using the abstract keyword cab be instantiated?
Does java vector allow null?