Question: java programming. One. Write a method public boolean hasOnlyoddDigits(int n) that returns true if its parameter n contains only odd digits (1, 3, 5, 7,
java programming. 
One. Write a method public boolean hasOnlyoddDigits(int n) that returns true if its parameter n contains only odd digits (1, 3, 5, 7, or 9), and returns false otherwise. Zero is counted as an even digit whenever it appears inside the number. Remember that for a positive integer n, the expression (n % 10) gives its last digit, and the expression (n / 10) gives its other digits. Correct answer true false false false 357199 7540573 97531000
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
