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 classes

630556Dec 16 2008 — edited Dec 16 2008
Ok, i think i understand better about abstract classes now. Just to make sure, Abstract classes and methods are implimented by their subclasses. This is the part i need clarifying. The subclasses can be instantiated by concrete classes which do not extend from them? e.g.
So i have an abstract class called Person which has a constructor which creates a Person Object.
I have a subclass of Person called Borrower which also has a constructor that is passed values. This class is not abstract.
I then have a concrete class call StudentBorrower which does not extend any of the above two classes. In order for me to create a Person object in this class, i have to instantiate the Borrower class dont i and not the abstract Person class? e.g.
Borrower.Person(...) (this syntax doesnt work though, not sure the exact way to do this)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 13 2009
Added on Dec 16 2008
4 comments
101 views