Question: The solution provided is not working for me, I am still getting the same error as mine. Need help, please. Thanks Here is error Exception

The solution provided is not working for me, I am still getting the same error as mine. Need help, please. Thanks

Here is error

Exception in thread "main" java.util.InputMismatchException at java.base/java.util.Scanner.throwFor(Scanner.java:939) at java.base/java.util.Scanner.next(Scanner.java:1594) at java.base/java.util.Scanner.nextInt(Scanner.java:2258) at java.base/java.util.Scanner.nextInt(Scanner.java:2212) at TomArrayListTest.main(TomArrayListTest.java:24)

Create a class ArrayListTest . Examples:

TomArrayListTest

SueArrayListTest

CindyArrayListTest

Etc.

This class is to contain:

A method that receives an ArrayList populated with an Integer data type holding the integers received from user input.

The user input is to accept Integers that are then assigned to the ArrayList until a value of 0 is entered, which is also assigned to the ArrayList.

The ArrayList is then to be sent to the method.

The method is then to return the largest value in the ArrayList.

If the ArrayList is sent in empty, the method will then return 0.

The method signature is to be: public static Integer max (ArrayList list).

Write additional code for testing your method.

The method will return the largest value that is displayed to the user.

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!