Java Student Project         


Address
Ability Level: Beginner  
Estimated Time: 40 minutes
Objectives:
  • To learn how to manipulate the output. 
  • To learn about using special characters.
Materials & Resources:
  • Java Software
  • Textbook
Overview:
Write a program that outputs your address as shown above. Be sure you box in the address.

This program must be user friendly, outputting the name of the program, the program author, and date written. Read the hints in this project for further understanding.

Instructions:
  1. Write a Java program that outputs your name, address, phone and fax numbers..

  2. Use comments to explain your program.

  3. Use the method [public static void main(String[] args] to create output.
Hints: Some important points to keep in mind in doing this project:

The file name and the project name need to be the same.

Writing a Java program

A. All Java statements must end with a semi-colon (;)

B. Programs may contain literal strings (a series of characters in double quotes)

C. Programs contain user-defined variables and methods

D. The statement System.out.println( "Hello") is an example of a call to a method of the out object which is contained in the static class System. This method accepts a string as an argument, in this case, "Hello" which is a string literal. The argument is passed to the method which displays it on the monitor

E. All programming statements in Java must be part of a class. A class name must conform to specific syntax rules.

1. The class name should be the same as the file name under which the program is saved

2. Class names are case sensitive, for style purposes should be capitalized, must start with a letter, and may contain only letters, digits, underscores or dollar signs. Letters in this case may include international characters

3. There are 48 keywords defined in Java 1.1 created by the Sun Corporation. Keywords may not be used as identifiers or class names

4. The contents of a class are contained within curly braces ( ie. { } )

5. A class may have an access modifier, such as Public, to describe when it may be accessed

6. A class may contain any number of variables and methods

F. Java programs may have comments which provide explanations of the program and its details to help programmers understand the code, and to make program modification and maintenance simpler.

1. There are three types of comments

a. Line comments begin a line in the program with two forward slashes, //. This causes the compiler to ignore the remaining characters on that line only

b. Block comments begin with /* and end with */. These comments may span more than one line, and the compiler ignores everything between them

c. Javadoc comments, unique to the Java language, which begin with /** and End with */. These comments are used by the javadoc utility to generate documentation.

Extras: In case you need to look at the J++ compiler steps: Starting Java