Write a static method called hasAlternatingParity that returns whether or not the digits of an integer have alternating parity (true if they do, false otherwise). The parity of a digit is 0 for even numbers and 1 for odd numbers.

Solved
Show answers

Ask an AI advisor a question