Using Graphics

This isn't meant as a knock to those of us who enjoy displaying arrays, incrementing variables, or using a constructor method, but let's face it—many subjects in a programming language such as Java tend to be dry.

It's hard to impress your non-programming acquaintances with the way your if-else statement determines which method to use in a mathematical application. When you're on a first date, you won't get far with the anecdote that illustrates how a switch-case block statement handles a variety of circumstances correctly. Nobody ever made a movie about the ternary operator.

Graphics programming is the exception to the rule. When you write a program that does something interesting with graphics, you can have fun with a programming ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH 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.