Strings are objects of the String class (java.lang.String). In other programming languages, the String, as you know it, was not provided through the language, the user had to use an array of characters to represent the String. This is why a String is not a primitive data type, it is instead a myriad of attributes (int length, char[position], etc.).
Because of the importance of the String, the creators of Java allowed a String to be simply made by String message = Ḧello World;
Nothing wrong with that, many people make objects of (instantiate) the String class that way...However you can also say...char[] arr = {'a','b','c'};
String myString = new String(arr);
That is the same as String myString = ¨abc¨;
This is because as aforementioned, a string is just a series of characters. There is, inside of the String class, a constructor (the thing that follows the new keyword and matches the class name) that accepts as a parameter, an array of characters.
Short answer : String is a class not a primitive data type, When making a String object, you are instantiating the String class
int
,'float', 'double', 'bool', – Schuss