Question: JAVA Write a boolean method called isOdd() in a class called OddTest, which takes an int as an argument and returns true if the int
JAVA
Write a boolean method called isOdd() in a class called OddTest, which takes an int as an argument and returns true if the int is odd, false if its not. The signature of the method is as follows: public static boolean isOdd(int number) Also write a main() method that prompts user for a number, calls the method isOdd sending the number and prints "ODD" or "EVEN" depending on the returned value of the method. You should test for negative input.
Run the program. Use the number 13. Run it again, use -2. Capture the console output.
Put the program code and output at the end of your text file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
