Chapter 5
OOP in Depth
Learning Objectives
By the end of this lesson, you will be able to:
- Implement interfaces in Java
- Perform typecasting
- Utilize the Object class
- Work with abstract classes and methods
Introduction
In the previous lesson, we looked at the basics of object-oriented programming, such as classes and objects, inheritance, polymorphism, and overloading.
We saw how classes act as a blueprint from which we can create objects, and saw how methods define the behavior of a class while fields hold the state.
We looked at how a class can acquire properties from another class through inheritance to enable us to reuse code. Then, we learned how we can reuse a method name through overloading – that is, as long as they have different ...
Get Java Fundamentals 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.