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 are the approaches that you will follow for making a program very efficient?
Explain listiterator and methods in listiterator?
What do you mean by ordered and sorted in collections in java?
What are three advantages of using functions?
How does thread synchronization occurs inside a monitor?
What is initial size of arraylist in java?
What do you mean by inner class in java? Explain
Can an arraylist be empty?
How do you convert int to char in java?
What is purpose of find feature?
Can we restart a thread already started in java?
Where is the singleton class used?
How is string stored in java?
Does substring create a new object?
What do you mean by constant time complexity?