O'Reilly logo

Java For Dummies, 7th Edition by Barry A. Burd

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 14

Sharing Names among the Parts of a Java Program

IN THIS CHAPTER

check Hiding names from other classes

check Exposing names to other classes

check Tweaking your code to find the right middle ground

Speaking of private fields and methods (and I do speak about these things in this chapter) …

I’m eating lunch with some friends at work. “They can read your email,” says one fellow. Another chimes in, “They know every single website that you visit. They know what products you buy, what you eat for dinner, what you wear, what you think. They even know your deepest, darkest secrets. Why, I wouldn’t be surprised if they know when you’re going to die.”

A third voice enters the fray. “It’s getting to the point where you can’t blow your nose without someone taking a record of it. I visited a website a few weeks ago, and the page wished me Happy Birthday. How did they know it was me, and how did they remember that it was my birthday?”

“Yeah,” says the first guy. “I have a tag on my car that lets me sail through toll booths. It senses that I’m going through and puts the charge on my credit card automatically. Every month, I get a list from the company showing where I’ve been and when I was there. I’m ...

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