Chapter 10
Putting Variables and Methods Where They Belong
IN THIS CHAPTER
Making something belong to an entire class
Putting variables inside and outside methods
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 belted 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 Jerseys 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 Class (What ...
Get Java For Dummies, 8th 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.