Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Get immediate answers to your questions from a wide network of experienced professionals on our Q&A platform. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Type the correct answer in the box. Spell all words correctly. Which class is required to create an object that accepts input in Java

Sagot :

Answer:

Explanation:

In order to ask for and accept an input in Java you first need to import the Scanner class into your file. Once you have imported this class you then need to create a Scanner object and assign it a variable. Next you would need to print to the system the question that you want the user to input an answer to. Lastly, you save the input into a string variable to use for later. An example of which can be seen in the following code...

Scanner input = new Scanner(System.in);

System.out.println("Enter an answer: ");

String answer = input.nextLine();