182k views
5 votes
Which of these statement(s) are true about data types in Java?

Primitive data types store the values as well.
 Boolean stores the addresses of where values are stored.
 Arrays and classes are examples of reference data types.
 Decimal and binary are examples of primitive data types.
 Objects and bytes are examples of boolean data types.

User Favolas
by
7.9k points

1 Answer

7 votes

Final answer:

Primitive data types in Java store actual values, while reference data types store addresses to the data. Boolean is a primitive type that holds true or false, not addresses. Arrays and classes are reference types, and byte is a primitive type; neither are boolean data types.

Step-by-step explanation:

The statements given need verification for their accuracy in the context of Java data types:

  • Primitive data types indeed store the actual values. This is true for data types like int, double, float, long, etc.
  • Boolean is a primitive data type itself and does not store addresses. It holds values either true or false.
  • Arrays and classes are indeed examples of reference data types in Java. They store references to the actual data.
  • Decimal is represented by the float and double primitive data types, but binary is not a data type. Instead, binary refers to the base-2 number system that all digital computers use internally.
  • Objects fall under reference data types, and bytes are a primitive data type. Neither are boolean data types, which only represent true/false values.
User Mrkiril
by
7.9k points