Name:
CS 120 Quiz 2
Tom Linton, Spring 1999, Moravian College
-
List two reserved words for visibility. Explain roughly what each means.
-
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.
-
Name three primitive data types in Java.
-
Shown below is the header declaration of a method:
-
What is the name of the method?
-
What is the return type?
-
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) { ... }