Skip to Content
Java Illuminated, 5th Edition
book

Java Illuminated, 5th Edition

by Julie Anderson, Hervé J. Franceschi
January 2018
Intermediate to advanced content levelIntermediate to advanced
1204 pages
28h 27m
English
Jones & Bartlett Learning
Content preview from Java Illuminated, 5th Edition

3.3 Calling Methods

Once an object is instantiated, we can use the object by calling its methods. As we mentioned earlier, the authors of classes publish their API so that their clients know what methods are available and how to call those methods.

Figure 3.2 illustrates how calling a class method alters the flow of control in our program. When this program starts running, the JVM executes instruction 1, then instruction 2, then it encounters a method call.

At that point, the JVM transfers control to the method and starts executing instructions in the method. When the method finishes executing, the JVM transfers control back to the program immediately after the point the method was called and continues executing instructions in the program. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Illuminated, 3rd Edition

Java Illuminated, 3rd Edition

Julie Anderson, Hervé J. Franceschi
Java How To Program, Late Objects, 11th Edition

Java How To Program, Late Objects, 11th Edition

Paul J. Deitel, Harvey M. Deitel

Publisher Resources

ISBN: 9781284141092