(1) locate the error in the following method and show how to fix it: private sta
ID: 3635487 • Letter: #
Question
(1) locate the error in the following method and show how to fix it:
private static boolean isEven (int n) {
if (n % 2 == 0)
return true;
}
(2) Simplify the following method as much as possible:
private static int cube (int n) {
int result ;
result = n * n * n;
return result;
}
(3) Write a class method name capitalizeWords that takes one parameter of type String.
The method should print its parameter, but with the first letter of each word capatilized.
For example, the call
capitalizeWords ( "abstract window toolkit") ;
will produce the following output:
Abstract Window Toolkit
// please provide explanations for your answers