What I'm trying to do
I'm trying to find an easy way to input multiple arguments in one String and pass parts of it on to get computed.
For example, terminal instructions are usually a String of multible instructions sudo foo bar = [sudo][foo][bar]
I don't know how to do this in java, or how it's supposed to be done.
So far I've tried
ArrayList<Integer> threadList = new ArrayList();
Scanner scanner = new Scanner(System.in);
public void printOptions(){
System.out.println("[1] > New Primefactordevision");
System.out.println("[Number] > Check Status of [Number]");
System.out.println("[x] [Number] > Terminates Primefactordivision of [Number]");
System.out.println("[x] > Terminate");
}
public void chooseOperation(){
printOptions();
String choice = scanner.next();
switch(choice){
case "1":{}
case "Number":{}
case String.format("x %s",threadList.get(*choice- x somehow*).toString()):{}
case "x":{}
}
The program is supposed to terminate a thread, computing primefactors out of an integer, when you type x [integer contained by threadList].
So basically the String has 2 arguments. [x] and [integer].
While it's not a problem to use x plus a defined integer as static parameter, it's a problem to have part of the choice parameter dynamically allocated from somewhere else, being conditional.
How is this supposed to be done?