Chapter 6

A Closer Look at Methods and Classes

image

This chapter resumes our examination of classes and methods. It begins by explaining how to control access to the members of a class. It then discusses the passing and returning of objects, method overloading, recursion, and the use of the keyword static. Also described are nested classes and variable-length arguments.

Controlling Access to Class Members

In its support ...

Get Java: A Beginner's Guide, Eighth Edition, 8th 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.