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 hash table in java?
Is there a case when finally will not execute?
Does the order of public and static declaration matter in main method?
What is difference between equals and hashcode method?
How does finally block differ from finalize() method?
Implementations of set interface?
What is ide with example?
How many types of interfaces are there?
What do you know about the garbage collector?
Can we sort hashmap in java?
What are mutable classes?
When is the finalize() called? What is the purpose of finalization?
Which is better 64 bit or 32 bit?
Is 0 true or is 1 true?
How many types of string data types are there?