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.
 
 
 
 
 
 
zanninso 0bcd6a5187
DEV-4788-HelloWorld-Java-Exercise (#1958)
1 year ago
..
README.md DEV-4788-HelloWorld-Java-Exercise (#1958) 1 year ago

README.md

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
$

Notions

Primitive Links
Logic operations
Operations