mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
999 B
999 B
IsEven
Instructions
Create a file IsEven.java
.
Write a function isEven
that returns true if the int passed in parameter is even, otherwise returns false.
Expected Functions
public class IsEven {
public static boolean isEven(int a) {
// your code here
}
}
Usage
Here is a possible ExerciseRunner.java to test your function :
public class ExerciseRunner {
public static void main(String[] args) {
System.out.println(IsEven.isEven(2));
System.out.println(IsEven.isEven(26));
System.out.println(IsEven.isEven(57));
}
}
and its output :
$ javac *.java -d build
$ java -cp build ExerciseRunner
true
true
false
$