Name:
CS 120 Quiz 2
Tom Linton, Spring 1999, Moravian College

 
  1. List two reserved words for visibility. Explain roughly what each means.

  2.  
     
     
     
     
  3. The syntax display for Data Declaration is:
[visibility] dataType dataItem [= initialValue];
    Give a legal declaration of an integer data field to hold the number of credit hours (for a student say) which is initialized to the value 12.
     
     
     
     
  1. Name three primitive data types in Java.

  2.  
     
     
     
     
     
     
     
  3. Shown below is the header declaration of a method:
    1. What is the name of the method?

    2.  
    3. What is the return type?

    4.  
    5. Using literals as arguments, complete a legal "call" to this method (by putting appropriate things between the parenthesis).

      myHouse.findArea(                         );

     
    Here is the method header declaration line:

    public double findArea( int innerSquare, double radius) { ... }