TODO4 - Use an if/else to determine the maximum of two integers and return that value.
"public int max(int a, int b)"
   
- Find the TODO4.java starter file; this empty class also serves as a solution you can experiment and play with.
- Next, read all of the comments at the top of the file in the file header.
- Set your runner in Main.java to use TODO4.java and comment out any other setRunner calls. (see the stepwise approach for more details)
- Determine the single function you need to declare inside the empty class. It's described in the comments and also at the top of this webpage.
- Declare the function "public int max(int a, int b) {return -1;}" and rerun the game - do you notice anything different on the console output?
- Note that this is the only function we've defined so far that takes input and provides non-void output.
- If you define the function above, the console output incorrectly reports the larger of the two player's scores as -1.
- If you can still see the correct high score for player 1 and player 2, make sure you named the function exactly as indicated, with correct spelling, capitialization, and keywords like "public" and "void".
- You can put the "@Override" statement directly above your declared method - this will help you discover syntax or typing errors.
- Inside your method, you must build one if statement that asks: "if variable "a" is bigger than variable "b", so "a" is the largest and should be returned."
- Extend that if statement using an "else {" so that if variable "a" isn't larger, we return variable "b" instead.
- Note that you are effectively duplicating Math.max(int, int), and so you shouldn't use that function in your solution
- Solution Enabled: The max() function correctly reports the larger of two values to the console when given two players' scores.
- Solution Disabled: The max function is broken and reports -1