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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -