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
What is predicate in java?
What is purpose of find feature?
List out five keywords related to exception handling ?
What is a superclass?
Can a variable be local and static at the same time?
Why string is immutable or final in java
What is e in java?
Can we initialize the final blank variable?
Can we extend private class in java?
What is the difference between pass by reference and pass by pointer?
What is the difference between choice and list?
Is it possible to specify multiple jndi names when deploying an ejb?
What is the primitive type short?
How do you join strings in java?
What is ph and buffers?