Skip to Main Content

New to Java

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 vs Private Constructor

843789Apr 22 2009 — edited Apr 22 2009
Hopefully this doesn't make me sound to naive

If we have a super class called food, and subclasses chocolate, chicken, cereal and so on then its clear we dont want to make instances of the super class food correct? So we can make this class an abstract class

What are the benefits of making a class abstract over making a constructor private and in what circumstance would it be beneficial to do one over the other?

Thanks, and sorry for a poor example!

Edited by: compSciUndergrad on Apr 22, 2009 4:53 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2009
Added on Apr 22 2009
11 comments
1,269 views