Class String in java? [closed]

-4

Hello friends, I'm studying java and I saw that in java there is no primitive data type "String" but there is a "String class" because? , which is a type of data referenced to an object but my other question is because they say it is a class and then I see that the String is an objectM

    
asked by simon 01.02.2017 в 01:15
source

1 answer

1

Hello, the primitive data for characters is char and since you know the char it is only possible to use a single character 'a', 'b', 'c', the class String wraps so to speak to the data type char and makes possible that you can form chains "stringCharacters".

Taking this into account the object is the variable that you declare from the String class:

String miObjetoCadena = new String();  
String miObjetoCadena2="";  
String miObjetoCadena3="Stack Over";  
String miObjetoCadena4= new String ("Stack Over");  
    
answered by 01.02.2017 / 01:31
source