Asked by Brian Metroz on May 17, 2024

verifed

Verified

Which of the following statements is NOT true?

A) Reference variables do not directly contain the data.
B) Reference variables contain the address of the memory space where the data is stored.
C) The operator new must always be used to allocate space of a specific type, regardless of the type.
D) A String variable is actually a reference variable of the type String.

Reference Variables

Variables that hold references to the locations of objects in memory, as opposed to containing the actual data value.

Operator New

In languages like C++ and Java, it's used to allocate memory for a new object or array from the heap.

Specific Type

Refers to a particular data type defined in a programming language that specifies the nature and characteristics of data that a variable can hold.

  • Absorb the knowledge of method declaration and the procedure for method invocation in Java.
verifed

Verified Answer

JM
Jamie MarieMay 23, 2024
Final Answer :
C
Explanation :
The operator new is only used for allocating memory for objects dynamically, not for all types of variables. For example, primitive data types like int or double do not need the operator new to allocate memory.