Hello Everyone,
I am having a problem with my homework. They are asking for a method call that takes the large of two absolute values.
Write a method called largerAbsVal that takes two integers as parameters and returns the larger of the two absolute values. A call of largerAbsVal(11, 2) would return 11, and a call of largerAbsVal(4, -5) would return 5.
I have tried this code using methods in the Math Class but I am getting an error in Practice-it that says
Line 4
Your method's return type is void, which means that it does not return a value. But your code is trying to return a value. This is not allowed.
cannot return a value from method whose result type is void
return Math.max(Math.abs(Num1), Math.abs(Num2));
Here is my code. What I am doing wrong?