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

//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 only call the new created method and when i enter a new input this new input should replace the old one //Java// i am trying to understand on how to create a method

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!