Hello, World!
Lab exercise #1: understand your first "Hello, World!" applet.
- Check the various versions one by one and discuss the differences with your lab partner. Start with version V1, the basic one.
For each version, copy the files in a directory in your account and do the work there.
- V1: Compile as:
javac HelloWorld.java
Then open the HelloWorld.html file in a browser to view the applet.
- V2: Read and try to understand how it differs from V1. Notice the comments: isn't it more readable now?
Then do all the exercises from V2.
- V3: Look at the java file and notice a different style for writing the comments. Is it readable?
Notice the Doc directory in V3. Open it and scan the documentation for the HelloWorld program. Notice where the
comments from the .java file appear on the documentation page.
Here is how you too can create documentation for your java programs, using javadoc:
- Copy the .java files in a new directory called Doc
- In Doc, run:
javadoc HelloWorld.java
- Open the Doc directory in a web browser and read the documentation. Bookmark it, if you want to read it later.
- The final version, readable and documented, ready to enter the Hall of Fame, is in the main directory (same as this readme file).
Use it as the model for all of your homework exercises from now on.
Notice the use of HTML tags in the documentation header
of the HelloWorld.java file, and check what they did to the on-line HelloWorld documentation.
To finish, practice javadoc by doing part 5 of the exercise from the main directory (same as this readme file).