Sams Teach Yourself Java 2 in 24 Hours

Sams Teach Yourself Java 2 in 24 Hours

By Rogers Cadenhead

Hour 11. Describing What Your Object Is Like

As you learned during last hour's introduction to object-oriented programming, an object is a way of organizing a program so that it has everything it needs to accomplish a task. Objects need two things to do their jobs: attributes and behavior.

Attributes are the information stored within an object. They can be variables such as integers, characters, Boolean values, or other objects such as String and Calendar objects. Behavior is the groups of statements used to handle specific jobs within the object. Each of these groups is called a method.

Up to this point, you have been working with the methods and variables of objects without knowing it. Any time your statement had a period in it that wasn't a decimal point or part of a string, chances are an object was involved. You'll see this during this hour as the following topics are covered:

Share ThisShare This

Informit Network