Question: //Java// i am trying to understand on how to create a method to read userInput where in the main method i should be able to
Sblic static void main(Stringl] args) Scanner in =new Scanner(System, in); String input= in. nextLine(); String[]list=input. split(" "); System. out.println(input); boolean flag= false; do { System.out. println("Please make a selectoion:"); System.out. println("1)Display the words:"); System.out.println("2)Enter new list:"); input=in. nextLine(); switch(input) \{ case "1": System.out, println("Display List ordered: "); myMet(list); break; case "2": System.out.println("Enter a new list: "); String input1= readInput(scan); myMet(list); break; \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
