Giving arrays as parameters | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Giving arrays as parameters

How can i give to my program a set of parameters as array public class Program { public static join(String...args) { return args.length==0 ?"no parameters passed ": String.join("," args ); } }

6th Nov 2021, 11:11 AM
Rine
2 Respostas
+ 5
I have put some code below that may be helpful https://code.sololearn.com/cK31e4GUFF9g/?ref=app
6th Nov 2021, 11:33 AM
SĆ¢Ć±tĆ“sh
SĆ¢Ć±tĆ“sh - avatar
+ 3
Here an example for unknown number of args: https://code.sololearn.com/cKI3TIvwylsV/?ref=app
6th Nov 2021, 12:57 PM
Coding Cat
Coding Cat - avatar