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 natural ordering in java?
What's the base class in java from which all classes are derived?
How to check if linked list contains loop in java?
What exceptions occur during serialization?
Can a class with private constructor be extended?
What is concurrent hashmap and its features?
Differences between external iteration and internal iteration?
What is final, finally, finalize?
Is a boolean 1 bit?
What is an immutable class? How to create an immutable class?
What is a "pure virtual" member function?
How do singleton patterns work?
What is difference between final and immutable?
How will you load a specific locale?
Are arrays dynamic in java?