0

Why the output is two ?

String a public class Example{ public static void main(String args[]){ String a ="one", b="two"; String str=String.join(a,b); System.out.println(str); } }

26th Dec 2018, 6:05 AM
Pramod Nayak
Pramod Nayak - avatar
6 ответов
+ 3
yeah thanks!! Jamie, I got it..
26th Dec 2018, 6:25 AM
Pramod Nayak
Pramod Nayak - avatar
+ 2
ok, then if I add one more variable c=“two” then the output will be “twoonetwo” as u have told, first parameter is delimeter. however, if I add one more variable then why can’t be the first parameter is not delimeter?
26th Dec 2018, 6:11 AM
Pramod Nayak
Pramod Nayak - avatar
+ 1
public class Example{ public static void main(String args[]){ String a ="one", b="two",c="two"; String str=String.join(a,b,c); System.out.println(str); } } The output is: twoonetwo
26th Dec 2018, 6:20 AM
Pramod Nayak
Pramod Nayak - avatar