+ 1

How to concatenate static string and user input String in java?

Example String str1="Sololearn"; Scanner scan=new Scanner(System.in); String str2=scan.nextLine(); input str2 string is "is best place to learn code" i want to concatenate str1 and str2 to how can i do it?

11th Aug 2018, 6:05 AM
Ajay Parmar
Ajay Parmar - avatar
3 Antworten
+ 2
String str3 = str1 + str2;
11th Aug 2018, 6:10 AM
Michaell Alavedra
+ 2
Thanks!!
11th Aug 2018, 6:38 AM
Ajay Parmar
Ajay Parmar - avatar
11th Aug 2018, 6:28 AM
Michaell Alavedra