We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Advanced
- Java Lambda Expressions
- Discussions
Java Lambda Expressions
Java Lambda Expressions
Sort by
recency
|
175 Discussions
|
Please Login in order to post a comment
public static PerformOperation isOdd() { return (num) -> num%2!=0; }
public static PerformOperation isPrime() { return (num) -> java.math.BigInteger.valueOf(num).isProbablePrime(100); }
public static PerformOperation isPalindrome() { return num -> num == reverseNum(num); }
private static int reverseNum(int num) { int result = 0; while(num > 0) { int val = num%10; result = (result * 10) + val; num = num/10; } return result; }
Here is Java Lambda Expressions solution in Java - https://programmingoneonone.com/hackerrank-java-lambda-expressions-problem-solution.html
Java 8 Solution:-
My solution:
interface Predicate{
} public class Solution {
}