Chapter 2. A Trip to Objectville: Classes and Objects
I was told there would be objects. In Chapter 1, we put all of our code in the main () method. Thatâs not exactly object-oriented. In fact, thatâs not object-oriented at all. Well, we did use a few objects, like the String arrays for the Phrase-O-Matic, but we didnât actually develop any of our own object types. So now weâve got to leave that procedural world behind, get the heck out of main(), and start making some objects of our own. Weâll look at what makes object-oriented (OO) development in Java so much fun. Weâll look at the difference between a class and an object. Weâll look at how objects can give you a better life (at least the programming part of your life. Not much we can do about your fashion sense). Warning: once you get to Objectville, you might never go back. Send us a postcard.
Chair Wars
(or How Objects Can Change Your Life)
Once upon a time in a software shop, two programmers were given the same spec and told to âbuild it.â The Really Annoying Project Manager forced the two coders to compete, by promising that whoever delivers first gets a cool Aeron⢠chair and adjustable height standing desk like all the Silicon Valley techies have. Laura, the procedural programmer, and Brad, the ...
Get Head First Java, 3rd 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.