+ 2

This doesn't work but is it possible without having to write string 3 times for x,y,z?

String x; y; z; x = "good job"; y= "somone knows"; z = "what there doing!"; System.out.println(x + y + z );

12th Jun 2017, 10:38 AM
D_Stark
D_Stark - avatar
4 odpowiedzi
+ 5
Try this way public class Program { public static void main(String[] args) { //String x; y; z; String x, y, z; x = "good job "; y= "somone knows "; z = "what there doing!"; System.out.println(x + y + z ); } }
12th Jun 2017, 11:34 AM
देवेंद्र महाजन (Devender)
देवेंद्र महाजन (Devender) - avatar
+ 7
Try this way System.out.println("good job"+"someone knows"+"what there doing!");
12th Jun 2017, 4:34 PM
Ekansh
+ 2
Uhm can you maybe tag your attempt to program it? Like this: https://code.sololearn.com/cC58qcBHCuRO/?ref=app
12th Jun 2017, 11:03 AM
Limitless
Limitless - avatar
+ 1
@ ekansh i wanted to use a string without having to write string 3x. Otherwise i would of just done System.out.println("good job someone knows what there doing"); but thats not what i wanted. @devender spot on mate 👍👍
12th Jun 2017, 8:31 PM
D_Stark
D_Stark - avatar