Answer Posted / amit kumar gupta
yes we can call by super() or this();
public abstract class Class1{
public Class1(){
System.out.println("Class1");
}
}
public class Class2 extends Class1{
public Class2(String Name){
System.out.println("Name = " + Name);
}
public Class2(){
this("AMIT"); // use only one this or super
super();
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is comparator in java?
Why doesn't the java library use a randomized version of quicksort?
What is the purpose of tostring() method in java?
Why Java doesn’t support multiple inheritance?
How do you add an element to a hashset in java?
When we serialize an object does the serialization mechanism saves its references too?
How can you write a loop indefinitely in java programming?
Does treeset use compareto?
What is fundamental datatype?
What is scope & storage allocation of static, local and register variables? Explain with an example.
Can a method inside a interface be declared as final?
What do you mean by mnemonics?
What is difference between path and classpath in java?
What is a arraylist in java?
What is difference between throw and throws ?