on Object References

Instructions:
For each question,
choose the single best answer.
Make your choice by clicking on its button.
You can change your answers at any time.
When the quiz is graded, the correct answers will appear in the box after each question.

1. Examine the following declarations:

int area;
String name;

Which of the following is true?

A. area is a primitive variable, and name is a reference variable.

B. area is a reference variable, and name is a primitive variable.

C.
both are primitive variables

D.
both are reference variables

2. Examine the following section of code:

int area;
String name;

How many objects have been created?

A.
None—there is one object reference variable, but no objects yet.

B.
One—there is one object reference variable so there must be one object.

How many objects (total) are created?
After the last statement has executed,
how many objects are now accessible (don't count garbage)?

A.
This section of code is incorrect.

B.
created: 5 now accessible: 5

C.
created: 1 now accessible: 1

D.
created: 5 now accessible: 1

The number you got right:
Percent Correct:
Letter Grade:

If you have returned here from another page,
or have re-loaded this page, you will need to click again on
each of your choices for the grading program to work correctly.
You may want to press the SHIFT KEY while clicking to clear
the old answers.