What do the two double quotations do in concatenation | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 1

What do the two double quotations do in concatenation

String firstName,lastName; firstName="Newton"; lastName="Volleyman"; System.out.println("My name is"+firstName+" "+lastName);

14th Nov 2016, 9:08 AM
3 Respostas
+ 1
in the double quotations you insert a simple space character, so that the output will be : My name is Newton Volleyman; If you don't put that the output would be: My name is NewtonVolleyman; It is just used to make the output look clear and easy to read
14th Nov 2016, 11:19 AM
Anitei Leonard
Anitei Leonard - avatar
+ 1
Double quotes(") are only used to print the text in that command. If double quotes aren't used, it will take it as to print the value of that variable.
6th Dec 2016, 2:52 AM
Deep chand
Deep chand - avatar
14th Nov 2016, 11:48 AM
Dominik Pahl
Dominik Pahl - avatar