import java.awt.*;
// this is the first Java application
public class Test {
public static void main (String [] args) {
System.out.println("Hi there!");
System.out.println("Welcome to CSci 1211!!");
}
}
To run (on Windows):
- Copy the code into a file
Test.java
in a directory
on C drive.
- Open Command Prompt window. Go to the folder where your programs
are:
cd C:\myprograms
(replace myprograms by the folder
where you copied the files).
- Compile the code:
javac Test.java
in the
Command Prompt window.
- Run it by command
java Test
.
This is an example from CSci 1211 course.