in this task why do we not add " " in the sys.out.println statement inside bracket
lvl2 task
Under discussion
Comments (5)
- Popular
- New
- Old
You must be signed in to leave a comment
pratyush prakash
2 July 2020, 09:47
its lvl 2 lesson1 task. basically while displaying string s in System.out.println(s) why do we dont use " " in s
0
Gellert Varga
1 July 2020, 22:53
You should always attach the program you wrote because that way we don’t know exactly what you’re talking about.
Maybe it was a string variable (with no quotation marks).
Only the text itself needs to be enclosed in quotation marks.
0
pratyush prakash
2 July 2020, 09:49
its lvl 2 lesson1 task my problem is while displaying string s in System.out.println(s) why do we not use " " in s. i dont know how to attach question pls can u explain
0
Gellert Varga
2 July 2020, 10:15
If you want to display a text directly, you should use the " " , this way:
But if you use a string type variable (s) in the print command, the variable s is not should be putted between the " " characters. This way:
If you write this:
then the output will be this: s +1
pratyush prakash
3 July 2020, 11:06
thank u
0