0
string
why in print we have to add "+" when we have to print two names together like println("the name is:"+x"+""+y+");
2 Respuestas
0
You don't have to do it if you dont want to. It is called string concatenation. It is there in the course to show how two strings can be added together.
0
You can also use String.format for better readability.
e.g. String.format("The name is: %s %s, name1, name2);
Name1, Name2 - both are strings.