In Java Write a method named changeEvens which accepts a 4-digit positive integer and substitutes even…

In Java

Place Order

Write a method named changeEvens which accepts a 4-digit
positive integer and substitutes even digits with zero and returns
a new integer. The new integer could have less digits. If the given
integer is not a 4-digit integer or it is a negative integer the
method returns zero.

  • Examples:

changeEvens(1000)-> 1000

changeEvens(-1000)-> 0

changeEvens(8764)-> 700

changeEvens(5829)-> 5009

changeEvens(1012)-> 1010