Im trying to print Hello World using Java with the String Concatenation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Im trying to print Hello World using Java with the String Concatenation

What I did is String x, y; x = "Hello"; y ="World"; System.out.println(x+" "+y); Unfortunatley it shows me an error, So i would need your help

20th Dec 2019, 7:16 PM
Ahmad Feras
5 Answers
+ 2
You have to initialize your variables with "" String x="",y="";
20th Dec 2019, 7:25 PM
Abdol Hashimi
Abdol Hashimi - avatar
0
I have already mintioned the code
20th Dec 2019, 7:22 PM
Ahmad Feras
0
But in the tutorial it says what I did
20th Dec 2019, 7:31 PM
Ahmad Feras
0
To be clear the error is in the last command but I dont know what mistake does it has
20th Dec 2019, 7:32 PM
Ahmad Feras
0
Figured that out, my double quotes were in the wrong places, thanks anyway
20th Dec 2019, 7:38 PM
Ahmad Feras