You are viewing a single comment's thread. Return to all comments →
public PerformOperation isOdd() { return (a) -> (a%2 != 0); } public PerformOperation isPrime() { return (a) -> (BigInteger.valueOf(a).isProbablePrime(100)); } public PerformOperation isPalindrome() { return (a -> String.valueOf(a).equals(new StringBuilder(String.valueOf(a)).reverse().toString())); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Lambda Expressions
You are viewing a single comment's thread. Return to all comments →