Getting input from user in the form of a command - Java -


I want to use a Java scanner as a command from the user < Em> Command arg arg is separated from the space.

I command and RGS to string [] call command .

thanks curlip

I have started now and I have it (thanks for some: ()

  public static zero main String [] args) {Boot.boot (); scanner scanner = new scanner (system.in); string [] command = scanner.nextLine () string () string [] command listopupput = Boot.command.commands.get (Command [0]); Object [] [] argsArray = New string [1] [command.length - 1]; Class (lt ;? & gt; [] argsArrayClasses = new class & lt ;? & gt; [] For {object []. Square}; for (int i = 0; i & gt; argeşararere Lamp - 1; i ++) {if (i! = 0) {argusarre [0] [i] = command [i];}} invoice mode (command listoputput [lanti-1], "command", Algueren Classes, Argasier [0]; Scan er.close ();}    

You can do something like

  scanner scanner = new scanner (System.in); string [] command = scanner.Nextin (). Trim (). Partition ("");   

Assume that you are reading commands with standard input.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -