Chapter 1

Test Your Thinking

The purpose of this chapter was just to make sure you could run a Java program. There's not much point in learning a computer language if you can't use it.

1) Since you are going to be programming frequently in this book, we suggest that you setup a "programming environment" for yourself. A programming environment is a configuration of your computer, or computer account, which allows you to write, compile, and run computer programs. We recommend that you setup your login environment to allow you to write, compile, and run Java programs. Once you have successfully completed the labs of this chapter, you should "lock in" that configuration so the next time you login to use your computer, you don't have to worry about the configuration again. This will save you a great deal of time in the future.

Answer:

The key point of the exercise was to "lock in" the configuration so that you can have a working Java environment every time you log into your computer. You don't want to waste time setting environment variables and such.

Unfortunately, we can't give you specific instructions on how to do this, since everyone's setup could be different. You want to be able to do the following things quickly and easily:

· Edit a file. You should be able to double click on a .java file and have a text editor start. You should also be able to save the file without quitting.

· Compile a program. You need to be able to compile your code files. Often. It's also recommended that you be able to see both the compiler output and the original code file. This makes it easier to understand any compiler errors that are generated. Compiler errors usually include the line number, so make sure you know how to find a specific line in a file.

· Re-edit the file. Much of your time you will be spent fixing errors in your code, so you can edit, save, compile and repeat without taking too much time to switch between tasks.

· Run your program. Whether your program is an application, or an applet, you will need to be able to run your program, otherwise there is no point to doing any of this. Make sure you can use the appletviewer program to test your applets.

There's news on using Java 2 applets from Internet Explorer and Netscpae!

Late Updates to Java 2 Applets