Skip to main content

Abstract

  • Chapter
  • First Online:
Book cover Java Quick Syntax Reference
  • 1631 Accesses

Abstract

Abstract classes are similar to interfaces in many ways. They can both define method signatures that subclasses must implement, and neither one of them can be instantiated. One key difference is that an abstract class can contain any abstract or non-abstract member, whereas an interface is limited to abstract members, nested types, and static constants, as well as static methods and default methods as of Java 8. Another difference is that a class can implement any number of interfaces but only inherit from one class, abstract or not.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 14.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Mikael Olsson

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Olsson, M. (2018). Abstract. In: Java Quick Syntax Reference. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3441-9_18

Download citation

Publish with us

Policies and ethics