Abstract Classes – some quick facts

  • An abstract class is a class that contains one or more abstract methods
  • Obviously, you cannot instantiate an abstract class
  • You can create a subclass, implement the abstract methods. The subclass can be instantiated
  • Not all methods in the abstract class need to be abstract.
  • Though a class doesn’t have any abstract methods, you can still define the class as abstract
  • A private method can’t be abstract. All abstracts must me public
  • An abstract class can’t be final

 

image

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