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 the overview of UDP messaging.
What is an exception in java?
What is indexof in java?
How to stop a thread in java? Explain about sleep () method in a thread?
How can we pass argument to a function by reference instead of pass by value?
What is the use of runnable interface?
What does a void function return?
Explain some best practices you would apply while using collection in java?
What is void data type?
Name few java util classes introduced with java 8 ?
Is vector synchronized in java?
difference between byte stream class and character stream class?
What is * argv?
What is bubble sort in java?
What is a short in java?