Can we inherit the constructor in a Class?please give one
example.
Answer Posted / amit
class demo
{
demo()
{
System.out.println("i am default constructor ");
}
}
class demo1 extends demo
{
demo1()
{
System.out.println("i am default constructor ");
}
}
class test
{
public static void main(String st[])
{
demo1 ob=new demo1();
}
}
but it is inherited constructor ....so be can say inherited constructor or/not ?????????
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is arrays sort in java?
What is an class?
Does windows 10 need java?
What is meant by class loader? How many types are there?
What is the difference between inner class and nested class?
What is the use of math abs in java?
Define jit compiler?
What is nested top-level class?
What is immutable in java?
How objects of a class are created if no constructor is defined in the class?
Can we call virtual funciton in a constructor ?
What is the default value of the local variables?
Why do we need wrapper class?
Is alive method in java?
How can you avoid serialization in child class if the base class is implementing the serializable interface?