0
When ever i run this program i get David4215.9Z but i want David,42,15.9,Z how to achieve my target ???
class MyClass { public static void main(String[ ] args) { String name ="David"; int age = 42; double score =15.9; char group = 'Z'; System.out.println (name + age + score + group); } https://code.sololearn.com/cnmNWTh8bUoE/?ref=app https://code.sololearn.com/cnmNWTh8bUoE/?ref=app
1 Odpowiedź
+ 4
Kumar Purushottam Just add ", " between the + operators like this.
System.out.printIn(name + ","+age+","+score+","+group);
It will output what you wants to.