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
Does substring create a new object?
What is difference between next () and nextline () in java?
Define inheritance with reference to java.
How can we achieve thread safety in java?
What is annotation in java?
What is the += operator called?
What is string data?
Is space a char?
What is the difference between this() and super() in java?
Define jre i.e. Java runtime environment?
What is the maximum size of a string in java?
What is a parameter in matrices?
what is the messsage u r going to get from an objectoriented programing?
Can we inherit a class with private constructor?
Can we define a package statement after the import statement in java?