Study Guide for Exam 1


The test will be open book and open notes.

Computer use WILL NOT be permitted.

Since the test will require hand-written answers, it is expected you will PRINT NEATLY. Sloppy hand-writing may result in a loss in points if I can't read it.

You will be given a short program that is full of errors. You will be required to identify the errors as follows:

  1. The line number in which the error occurs
  2. The nature of the error
  3. The correction for the error
  4. The type of error.

Familiarize yourself with:

The correct syntax for a simple Java program
How to write a class signature: public class SomeClass {}
How to write a method signature: scope returntype methodName(arg list) {}
Standard naming conventions for class files, methods, and variables
Rules for indentation

You will be given a short program with one or more assignment statements. You will be required to identify the values of variables as the program executes.

/**
  * Description
  *
  * @author Joe Sweeney 
  * Assignment # 
  * 
  */
public class SomeClass {
      
   public static void main(String args[]) {
      
      String word1 = args[0];
      int wordLen = word1.length();

   }
}
   
java SomeClass Hello, World!