For example, BinarySearch is two static methods, rank() and main(). The first
static method, rank(), is four statements: two declarations, a loop (which is itself an assignment
and two conditionals), and a return. The second, main(), is three statements:
a declaration, a call, and a loop (which is itself an assignment and a conditional).
To invoke a Java program, we first compile it using the javac command, then run it using
the java command. For example, to run BinarySearch, we first type the command
javac BinarySearch.java (which creates a file BinarySearch.class that contains
a lower-level version of the program in Java bytecode in the file BinarySearch.class).
Then we type java BinarySearch (followed by a whitelist file name) to transfer control
to the bytecode version of the program. To develop a basis for understanding the
effect of these actions, we next consider in detail primitive data types and expressions,
the various kinds of Java statements, arrays, static methods, strings, and input/output.