Chapter 10. Object-Oriented programming

In this chapter, we will discover that in Java, classes are fundamental to just about everything. We will begin to understand why the software engineers at Sun Microsystems back in the early 1990s made Java the way they did.

We have already talked about reusing other people's code, specifically the Android API, but in this chapter, we will really get to grips with how this works and learn about object-oriented programming and how to use it.

In summary, we will cover the following topics:

  • What is OOP, including encapsulation, inheritance, and polymorphism
  • How to write and use our first class in an app

Before we get to what exactly OOP is, a quick warning.

Important memory management warning

I'm referring to our ...

Get Android Programming for Beginners - Second 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.