Java OCA OCP Practice Question 251

Question

Which statement is true about primitives?

  • A. Primitive types begin with a lowercase letter.
  • B. Primitive types can be set to null.
  • C. String is a primitive.
  • D. You can create your own primitive types.


A.

Note

An example of a primitive type is int.

All the primitive types are lowercase, making Option A correct.

Unlike object reference variables, primitives cannot reference null.

String is not a primitive as evidenced by the uppercase letter in the name and the fact that we can call methods on it.

You can create your own classes, but not primitives.




PreviousNext

Related