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
How many types of parsers are there?
What is time complexity algorithm?
Can we override constructor in java?
How do you compare arrays in java?
What is a null check?
What is your platform?s default character encoding and how to know this?
What technique can be employed to compare two strings?
What is the difference between Error, defect,fault, failure and mistake?
what is the purpose of the runtime class?
Which is the class in java?
When is an object subject to garbage collection?
Is java call by reference?
What is scope of a variable?
what is a green thread? : Java thread
What is the difference between interface & abstract class?