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