Ad

It will be faster, if you use bit operation

Code
Diff
  • class Calculator {
      
      public boolean isEven(int number) {
        return (number & 1) == 0;
      }
      
    }
    • class Calculator {
    • public boolean isEven(int number) {
    • return (number % 2) == 0;
    • return (number & 1) == 0;
    • }
    • }