Java OCA OCP Practice Question 1048

Question

Select the list of primitives ordered in smallest to largest bit size representation.

  • A. boolean, char, byte, double
  • B. byte, int, float, char
  • C. char, short, long, float
  • D. char, int, float, long
  • E. None of the above


D.

Note

The sizes of the primitives are as follows:

  • byte, 8 bits;
  • char, 16 bits;
  • short, 16 bits;
  • int, 32 bits;
  • float, 32 bits;
  • long, 64 bits;
  • double, 64 bits.

The Java specification does not state the size of a boolean, so it is not accurate to call it the smallest primitive.




PreviousNext

Related