public class
EvenOddWoCondition {
/**
* Return even odd result.
* @param number
* @return even or odd.
*/
private static String
getEvenOddRest(int number) {
String[]
array = {"even","odd"};
int index = number%2;
return
array[index];
}
public static void
main(String[] args) {
int number = 10;
String result = getEvenOddRest(number);
System.out.println(result);
}
}
No comments:
Post a Comment