O'Reilly logo

The Java® Tutorial: A Short Course on the Basics, 6th Edition by Sharon Biocca Zakhour, Joni Gordon, Sowmya Kannan, Scott Hommel, Raymond Gallardo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Interfaces and Inheritance

You saw an example of implementing an interface in the previous chapters. You can read more about interfaces in the first section of this chapter—what they are for, why you might want to write one, and how to write one. The second section of this chapter describes the way in which you can derive one class from another. That is, how a subclass can inherit fields and methods from a superclass. You will learn that all classes are derived from the Object class, and how to modify the methods that a subclass inherits from superclasses. This section also covers interface-like abstract classes. Each section ends with questions and exercises to test your understanding.

Interfaces

There are a number of situations in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required