O'Reilly logo

Sams Teach Yourself Java™ 2 Platform in 21 Days Professional Reference Edition by Rogers Cadenhead, Laura Lemay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Using Methods to Accomplish Tasks

Methods are arguably the most important part of any object-oriented language, because they define every action an object takes.

Classes and objects provide a framework. Class and instance variables provide a way to describe what these classes and objects are. Only methods can define an object's behavior—the things it is capable of doing and the way it interacts with other classes and objects.

Yesterday, you learned some things about defining methods, and you could use this knowledge to create Java programs. You would, however, be missing some features that make methods powerful—features that make your objects and classes more efficient and easier to understand. Today you learn about the following features: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required