Anyone can tell that how can I print two names in java ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Anyone can tell that how can I print two names in java ??

7th Apr 2021, 3:40 PM
Ashutosh Pandey
Ashutosh Pandey - avatar
3 Answers
+ 1
Thankyou
7th Apr 2021, 3:52 PM
Ashutosh Pandey
Ashutosh Pandey - avatar
+ 1
There's three ways actually: String name1 = "John Doe"; String name2 = "Jane Smith"; System.out.println(name1 + name2); System.out.printf("%s %s", name1, name2); System.out.print(name1 + name2 + "\n");
4th Feb 2022, 4:05 AM
HydroShock
HydroShock - avatar
0
System.out.print("name"+"name");?
7th Apr 2021, 3:51 PM
Ananiya Jemberu
Ananiya Jemberu - avatar