Exercise 1: Exploring Java™ Programs Errors
In this exercise, your solve compilation and runtime errors.
Preparation
Before your begin, use the cd command in the terminal window to change directories to exercises/mod01_intro/exercise1/.
cd ~/exercises/mod01_intro/exercise1/
Note – For Microsoft Window users, the ~ character in the Unix ® enviroment
represents the user's home directory. When you see this character, replace it with the directory
hierarchy of your home directory. For stardard Sun Educational Services courses, this directory is
\export\home\student
. Therefore, the correct cd command to use is:
cd \export\home\studet\exercise\mod01_intro\exercise1\
Task
Perfom the following:
- Correct the
Test1
program.
- Compile the
Test1.java
file
Fix any compilation errors and recompile.
- Execute the
Test1.java
file.
Fix any runtime errors recompile and re-run
- Correct the
Test2
program.
- Compile the
Test2.java
file
Fix any compilation errors and recompile.
- Execute the
Test2.java
file.
Fix any runtime errors recompile and re-run
- Correct the
Test3
program.
- Compile the
Test3.java
file
Fix any compilation errors and recompile.
- Execute the
Test3.java
file.
Fix any runtime errors recompile and re-run
- Correct the
Test4
program.
- Compile the
Test4.java
file
Fix any compilation errors and recompile.
- Execute the
Test4.java
file.
Fix any runtime errors recompile and re-run