Chapter 10

Putting Variables and Methods Where They Belong

In This Chapter

arrow Making something belong to an entire class

arrow Putting variables inside and outside methods

arrow Improving your batting average

Hello, again. You’re listening to radio station WWW, and I’m your host, Sam Burd. It’s the start again of the big baseball season, and today station WWW brought you live coverage of the Hankees versus Socks game. At this moment, I’m awaiting news of the game’s final score.

If you remember from earlier this afternoon, the Socks looked like they were going to take those Hankees to the cleaners. Then, the Hankees were belting ball after ball, giving the Socks a run for their money. Those Socks! I’m glad I wasn’t in their shoes.

Anyway, as the game went on, the Socks pulled themselves up. Now the Socks are nose to nose with the Hankees. We’ll get the final score in a minute, but first, a few reminders. Stay tuned after this broadcast for the big Jersey’s game. And don’t forget to tune in next week when the Cleveland Gowns play the Bermuda Shorts.

Okay, here’s the final score. Which team has the upper hand? Which team will come out a head? And the winner is . . . oh, no! It’s a tie!

Defining a ...

Get Java For Dummies, 5th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.