O'Reilly logo

Java All-in-One For Dummies, 4th Edition by Doug Lowe

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 5

Using Abstract Classes and Interfaces

In This Chapter

arrow Understanding abstract methods and classes

arrow Using basic interfaces

arrow Using interfaces as types

arrow Adding constants to an interface

arrow Inheriting interfaces

arrow Working with callbacks

arrow Using default methods

In this chapter, you find out how to use two similar but subtly distinct features: abstract classes and interfaces. Both let you declare the signatures of the methods and fields that a class implements separately from the class itself. Abstract classes accomplish this by way of inheritance. Interfaces do it without using inheritance, but the effect is similar.

warning.eps This chapter also covers a new feature of Java 1.8 called default methods ...

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