Compiling an Application with Multiple Classes

You must compile the classes in Fig. B.1 and Fig. B.2 before you can execute the application. First, change to the directory that contains the application’s source-code files. Next, type the command

javac GradeBook.java GradeBookTest.java

to compile both classes at once. If the directory containing the application includes only this application’s files, you can compile all the classes in the directory with the command

javac *.java

The asterisk (*) in *.java indicates that all files in the current directory that end with the file-name extension “.java” should be compiled.

Get Android™ How to Program, Second 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.