0
What is the function of third + symbol in concatenate string ?
String firstName, lastName; firstName = "David"; lastName = "Williams"; System.out.println("My name is " + firstName +" "+lastName correct me if I am wrong the first + sign concatenates "My name is" with ' first name' then the second + sign does the same for 'first name' and 'last name' string what is the use of third + sign?
5 Answers
+ 1
+ concatenates without adding spaces, so there's one added in the middle: " "
String + variable + space + another variable.
+ 1
If you want to take a fixed number of inputs, I would use a for loop, then append the input of each loop to some container.
I could only show you in Python unfortunately. ;) But maybe someone else will jump in...
0
thanks :) I have tones of things to ask. Is there any tag option here or can we connect in any other medium?
0
like here in user input section they have shown only how to get input form user. I want to know how to write this statement...like first you specify how many input you want (2,3)
after that you give the input like i1,i2 in this manner. can you tell me sensei?
0
haha thanks for your feedback :)