I made a mistake, so I'm posting it to organize it.
String name = "Tanaka-kun"; String name = new String ("Tanaka-kun"); These two have the same meaning, and specially because strings are often used. You can enter with ** String name = "Tanaka-kun"; **.
In other words, it becomes a character string object, and Tanaka-kun is not assigned to the variable name, but reference data is stored in name.
Recommended Posts