Practice Problem 2: Hello World
Objective: To learn how to write, compile, execute, and turn in a Java program
I showed you the following program in class:
/* Craig Persiko
HelloWorld.java
Simple Hello World program
*/
class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!"); //Display the string.
}
}
Here is your assignment:
- Unlike other practice problems, you must each do this assignment for yourself (no group work).
- Your program should be exactly like the above program, except yours should have your name, the file's
name (as above), and "CS 111A Practice Problem 2" in the comment at the beginning, instead of my name.
- Make sure to compile your program (using javac), and then execute the file produced by the compiler
(using java).
- Turn in your source code and the test run showing how your program worked.
- You may use whichever compiler you wish, but I recommend you do this assignment on hills or on Linux, in
order to get some experience with this environment. Follow the instructions given in
class and in the
Computer Access and Use Information handout.
- Make sure to submit your homework on Insight, on the Assignment
page for Practice Problem 2.
Return to main CS 111A page