Chapter 5
Using Abstract Classes and Interfaces
In This Chapter
Understanding abstract methods and classes
Using basic interfaces
Using interfaces as types
Adding constants to an interface
Inheriting interfaces
Working with callbacks
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.
Get Java All-in-One For Dummies, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.