Chapter 3. Encapsulation: Time to Write Some Code

Yesterday, you learned all about encapsulation. As you begin today’s lessons, you should have a good idea of what encapsulation is, how to apply it effectively, and what common mistakes to keep an eye out for. What you don’t have at this point is hands-on experience with the technique. Sure, you know the theory, but nothing beats getting down and dirty with code. For the rest of the day, you’ll complete a number of labs that should cement the lessons of Day 2.

Today you will learn

  • How to set up the Java environment

  • About class basics

  • How to implement encapsulation

  • About the Java primitive wrappers

Lab 1: Setting Up the Java Environment

You will use the Java programming language to complete all of the ...

Get Sams Teach Yourself Object Oriented Programming in 21 Days, 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.