java - How do I enter 2 inputs before entering -
i need program take 2 inputs, separated comma. example, user type in 5,12 , program read in both 5 , 12. how do that?
read command-line arguments:
public class echo { public static void main (string[] args) { (string s: args) { system.out.println(s); } } }
if have comma separated input read 1 input: args[0]
can split afterwards:
string[] items = commaseparated.split(",");
Comments
Post a Comment