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
|
166 Discussions
|
Please Login in order to post a comment
works well for java 15 import java.util.Scanner;
interface PerformOperation { boolean check(int a); }
class MyMath { // Method to check if the number is odd public static PerformOperation isOdd() { return (int a) -> a % 2 != 0; }
}
public class Solution { public static void main(String[] args) { MyMath math = new MyMath(); Scanner sc = new Scanner(System.in); int T = sc.nextInt();
}
The predefined code for Main class in Java 8 is wrong. Had to switch to Java 15 for my code to work.