Which of the following statements are correct?

a. A reference variable is an object.
b. A reference variable references to an object.
c. A data field in a class must be of a primitive type.
d. A data field in a class can be of an object type.


b. A reference variable references to an object.
d. A data field in a class can be of an object type.
(a) is wrong because a reference variable is not an object, it is a reference that points to an object. (c) is incorrect because a class may have a data field of an object type such as String.

Computer Science & Information Technology

You might also like to view...

A title is a(n) ________ given to a figure in a document, numbered sequentially

Fill in the blank(s) with correct word

Computer Science & Information Technology

The problem with using global variables is that they work against object-oriented programming principles.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

Each column in a range represents a(n) ____________________ that describes some attribute or characteristic of a person, place, or thing.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Ad hoc mode is also known as _______________ mode.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology