9.2k views
1 vote
T F Java has eight primitive data types. String is one of them.

User Mat
by
5.5k points

1 Answer

6 votes

Answer:

F

Step-by-step explanation:

A data type is said to be primitive if it contains simple values of a particular type.

Java has eight primitive data types:

  • boolean,
  • byte,
  • char,
  • short,
  • int,
  • long,
  • float,
  • double

As we can see, String is not a primitive data type. Rather, String is an object of type java.lang.String(); It contains methods such as length(),charAt(), toUpperCase() etc. None of the primitive types have methods associated with them.

User Tandav
by
5.3k points