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 <> used for in java?
What is static keyword in java?
What is early binding and late binding in java?
How would you format a date in java? I.e. In the ddmmyyy format?
How do you classify Dialog Box?
What environment variables are required to be set on a machine in order to run Java programs?
What are the two categories of data types in the java programming language?
What are peerless components in java programming?
What is the difference between class & structure?
What causes memory leak in java?
Does java list allow null?
What is a private class in java?
Can a private method of a superclass be declared within a subclass?
What is the maximum size of list in java?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?