Stopping by Java Boutique for Directions
This world tour of Java programs is being led by a professional who is well-versed in the hazards and highlights of web-based travel. You’ll be venturing out on your own trips soon, so it’s worthwhile to stop at one of the best guides for the tourist who wants to see Java: Java Boutique at http://javaboutique.internet.com.
Java Boutique features a directory of Java programs and programming resources related to the language. One of the best uses of the site for programmers is to see what programs are available that offer source code. In case you’re unfamiliar with the term, source code is another name for the text files that are used to create computer programs. The Saluton.java file you developed during Hour 2 is an example of source code.
The Source Code link on the Java Boutique’s home page lists the programs in the site’s directory that include their source code.
One of the programs whose source code is available is Aleksey Udovydchenko’s Absolute, a space videogame in which you control a ship and blast your way through an asteroid field (see Figure 3.6). The game features scrolling animation, graphics, keyboard control, and sound. To learn more and play the game, visit http://javaboutique.internet.com/Absolute.
Figure 3.6. Source code for Java programs such as Aleksey Udovydchenko’s space shoot-’em-up Absolute can be found using Java Boutique.
The entire Absolute program was written in just more than 700 lines of code. That’s an extremely small number, considering everything the program does. Java includes an extensive library of classes you can use in your own programs. Udovydchenko employs a class called Image to display graphics such as asteroids and an AudioClip class to play sounds such as laser fire and explosions.
One goal of Java’s design was to make it easier to learn than C++, the language Gosling was having fits with on his smart-appliance project. Much of Java is based on C++, so programmers who have learned to use that language find it easier to learn Java. However, some of the elements of C++ that are the hardest to learn and use correctly are not present in Java.
For people learning programming for the first time, Java is easier to learn than C++. Some languages are created to make it easier for experienced programmers to harness the capabilities of the computer in their programs.
These languages include shortcuts and other features that programming veterans easily understand.
Java does not use some of these features, preferring to make the language as simple as an object-oriented programming language can be. Java was created to be easy to learn, easy to debug, and easy to use Java includes numerous enhancements that make it a worthy competitor to other languages.