We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5857d72 commit 59c8b08Copy full SHA for 59c8b08
1 file changed
java8Tutorials/src/main/java/java8/functionalInterface/PredicateInterfaceDemo1.java
@@ -0,0 +1,28 @@
1
+package java8.functionalInterface;
2
+
3
+import java.util.function.Predicate;
4
5
+/**
6
+ *
7
+ * @author saurav
8
9
+ */
10
+public class PredicateInterfaceDemo1
11
+{
12
+ public static Boolean checkSpeed(int speed)
13
+ {
14
+ if(speed>20)
15
16
+ return true;
17
+ }
18
+ else
19
20
+ return false;
21
22
23
+ public static void main(String[] args)
24
25
+ Predicate<Integer> predicate=PredicateInterfaceDemo1::checkSpeed;
26
+ System.out.println(predicate.test(50)); // output : true
27
28
+}
0 commit comments