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 included in core java?
Is string is a keyword in java?
Can java list be null?
What is operator overloading. Is it is supported in java?
Which data type is a class in java?
Which class is used by server applications to obtain a port and listen for client requests?
Can we make main() thread as daemon?
Can we serialize singleton class?
Will the jvm load the package twice at runtime?
How do you compare arrays in java?
What does string [] args mean?
what is the purpose of the runtime class?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is gc()?
Explain inner classes ?