Chapter 6

Q1) What is encapsulation?

A) Encapsulation is the way we pack our variables, code, and methods in a manner that exposes just the parts and functionality we want to the parts of our app (or any app that uses our classes) that we want.

Q2) I don't get all this, and actually, I have more questions now than I had at the start of the chapter. What should I do?

A) You know enough about OOP to make significant progress with games and any other type of Java programming. If you are desperate to know more OOP right now, there are plenty of highly rated books that discuss nothing but OOP. However, practice and familiarity with the syntax will go a long way to achieving the same thing and will probably be more fun. The deciding factor in whether you ...

Get Learning Java by Building Android Games 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.