In Java, Why String is non-primitive data type?

后端 未结 10 2146
闹比i
闹比i 2021-01-01 03:10

In Java, we can directly use String to declare a string variable name and specify its value. We do not have to define the string as an array by using new keywor

10条回答
  •  醉酒成梦
    2021-01-01 03:26

    String is a Java Object and not a primitive data type. String is part of the java.lang package that is imported by default in any java project.

    There is no need to define an array of char, just use String.

    Possible duplicate: Java String import

提交回复
热议问题