Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Abstract class and constructor

807569Jun 12 2006 — edited Jun 13 2006
Hi all,

I am relatively new to Java and have some doubts on Abstract class and its constructor and subclass from it. Can someone help?

Q1. Can abstract class have constructor? As it cannot be instantiated, can it still have constructor?

Q2. I saw an example which has an abstract class and a subclass which extends from this abstract class. In the abstract class, there is a constructor with implementation. But in the subclass, the author only provide an empty constructor. My question is, when the subclass gets instantiated, will it execute the constructor in the abstract class?

Confused.

Message was edited by:
han
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 11 2006
Added on Jun 12 2006
3 comments
677 views