O'Reilly logo

Sams Teach Yourself Object Oriented Programming in 21 Days, Second Edition by Anthony Sintes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required