Skip to main content

Inheritance

  • Chapter
  • First Online:
Scala for Java Developers
  • 1658 Accesses

Abstract

In this chapter we'll look at inheritance in Scala: how you create subclasses and override methods, the Scala equivalent of interfaces and abstract classes, and the mechanisms Scala offers for mixing in reusable behavior. We'll finish by discussing how to pick between all the options.

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

Access this chapter

eBook
USD 24.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 32.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Since Scala 2.12, anonymous classes can be converted into Java SAMs automatically.

  2. 2.

    http://amzn.to/1yskLc7

  3. 3.

    http://www.artima.com/pins1ed/traits.html#12.7

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Toby Weston

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Weston, T. (2018). Inheritance. In: Scala for Java Developers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3108-1_11

Download citation

Publish with us

Policies and ethics