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 different types of classloaders?
Can we store variables in local blocks?
What are the main features of java?
What is the difference between static binding and dynamic binding?
What is var keyword ?
State the difference between strings and arrays.
How do you clear a method in java?
What does super keyword do?
Difference between Preemptive scheduling vs. Time slicing?
What is a ternary operator in java? What is an interface?
How to sort an array in java without using sort method?
What is difference between length and length() method in java ?
What is data object example?
How objects are stored in java?
Which number is denoted by leading zero in java?