Start Java

Source Files

Compiling

Applet versus Application

Running

Hello World as an Application

Edit HiWorld.java in your Linux environment and type in this code (note, you cannot copy/paste it, so practice by typing):


Play around and try these errors:

Error - Compiling hiworld.java instead of HiWorld.java
Error - Compiling HiWorld instead of HiWorld.java
Error - Running HiWorld.java instead of HiWorld
Error - Running HiWorld.class instead of HiWorld

Hello World as an Applet

Type in the code for the HelloWorld Applet (note, you cannot copy/paste it, so practice by typing):

Java Assignments for HW7:

  1. Update the HiWorld program and turn this newer version in: Using two statements, have it print out "From <yourName>" after printing "Hello World!", but with your name on the same line.

  2. Update the HelloWorld Applet and turn this newer version in: Using two statements, have it print out "From <yourName>" after printing "Hello World!", but put your name on the line below (line up the left-hand side of the 2 strings).