You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Write a method named isEven that accepts an int argument. The method should return true if the argument is even , or false otherwise.Also write a program to test your method.
publicclassQuestion2 {
publicstaticbooleanisEven(inta) {
return ((a % 2) == 0);
}
publicstaticvoidmain(String[] args) {
System.out.println(isEven(5) + " is a even number");
System.out.println(isEven(10) + " is a odd number");