Can you have a constructor in abstract class?
Answer Posted / abdul hannan
Yes. We can have constructor in an abstract class but we can
not directly instantiate it. If the abstract class have no
argument constructor, it will automatically call by the
constructor of subclass through constructor chaining. If
abstract class have constructor with argument, then we need
to call it by super() and pass the argument in it.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Explain inner classes ?
What is Java Package and which package is imported by default?
What are the data types supported by java?
Which is illegal identifier in java?
How to instantiate static nested classes in java?
What is bool mean?
List down the methods and interfaces of collection class in java.
How to sort double array in java?
What does += mean coding?
What is polymorphism in java? What are the kinds of polymorphism?
What about member inner classes?
How do you define a singleton class?
What is float in java?
What is array size in java?
Why isn’t there operator overloading?