creation: 9/04/99


Fill in the Blanks

Instructions:   This is an ungraded fill-in-the-blank exercise. Each question consists of a sentence with one or two words left out. A button represents the missing word(s). For each question, think of the word or phrase that should fill each blank, then click on the buttons to see if you are correct. No grade is calculated for this exercise.


1.      A two dimensional geometric point can be represented with an object of class which is found in the class library



2.      A class definition may include several which are used with the new operator to create an object of that class.


3.       A is an item of data supplied to a method when the method is invoked.


4.      All objects have a method that returns a string that represents the object.


5.      An object that has no references to it is called .


6.      If several reference variables refer to the same object, each variable is said to be an of the object.


7.      To check if two reference variables both refer to the same object, use the operator.


8.      To check if two different objects contain equivalent data, use the method.


9.       Examine the following code:
Integer a = new Integer( 26 ) ;
System.out.println( a ) ;
The println() method expects a parameter that is a reference to a . Since the object referenced by a is of class Integer, the object's method is automatically called.


10.       Examine the code in each row. Decide if the printed output will be true or false.

 

code sectionOutput
Point pointA = new Point( );
Point pointB = new Point( 0, 0 );
System.out.println( pointA == pointB );
Point pointA = new Point( 21, 17 );
Point pointB = pointA;
System.out.println( pointA == pointB );
Point pointA = new Point( 21, 17 );
Point pointB = new Point( 21, 17 );
System.out.println( pointA == pointB );
Point pointA = new Point( 21, 17 );
Point pointB = new Point( 21, 17 );
System.out.println( pointA.equals( pointB ) );
Point pointA = new Point( 21, 17 );
Point pointB = new Point( 21, 17 );
pointA.move( 8, 12 );
System.out.println( pointA.equals( pointB ) );



End of the Exercise. If you want to do it again, click on "Refresh" in your browser window.

Click here to go back to the main menu.