Creating Variables

For the purposes of this hour's examples, you'll be looking at a class of objects called Virus whose sole purpose in life is to reproduce in as many places as possible—much like some of the people I knew in college. A Virus has several different things it needs in order to do its work, and these will be implemented as the behavior of the class. The information that's needed for the methods will be stored as attributes.

Watch Out!

This hour will not teach actual virus writing, though it might provide some insight into how virus programs work as they wreak havoc on the file systems of the computer-loving world. This publisher had scheduled Sams Teach Yourself Virus Programming in a Three-Day Weekend for next spring, but the ...

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.