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

后端 未结 10 2129
闹比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:43

    Yes String is an object in Java. The fact that it can be used similar to primitives does not contradict

    Please refer - Strings are objects in Java, so why don't we use 'new' to create them?

提交回复
热议问题