object oriented programming question about classes in java via /r/learnprogramming


object oriented programming question about classes in java

I'm trying to understand creating an object of a subtype, but having it declared as a supertype. When would you want to do this, what are the benefits?

ex: Employee abstract class and Manager subclass.

Employee manager = new Manager();

Also is there a difference between a superclass and an abstract class?

Submitted July 13, 2017 at 11:15PM by Kimcheeboy1
via reddit http://ift.tt/2ul06Jy

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s