Chapter 4: Methods


Overview

So far, all of the Java applications we have seen have been linear: The processing has proceeded line by line, from the start through the end of the block that begins public static void main(String[] args).

Such applications don't really take full advantage of your computer's capability. In fact, with linear code your computer is not much more than an expensive calculator. The topics in the following two chapters will begin to branch out—and so will the paths of execution through the programs we will study. Instead of proceeding line by line, we will see how to make the execution path detour, fork, and loop.

This chapter will look at methods, which are detours in the path of execution. Chapter 5, "Conditionals and Loops," will introduce statements that redirect the flow of the program.




Ground-Up Java
Ground-Up Java
ISBN: 0782141900
EAN: 2147483647
Year: 2005
Pages: 157
Authors: Philip Heller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net