This chapter is the second part of our whirlwind tour (theoretical and practical) of OOP. We have already briefly discussed the concepts of encapsulation, inheritance, and polymorphism, but in this chapter, we will get to see them in action in some demo apps. While the working examples will show these concepts in their simplest forms, it will still be a significant stepping stone toward taking control of our layouts via our Java code.
In this chapter, we will explore the following topics:
Encapsulation in depth and how it helps us
Inheritance in depth and how to take full advantage of it
Polymorphism explained in greater detail
Static classes and how we have been using them already
Abstract classes and interfaces
First, we will handle encapsulation.