Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//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 image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions