Skip to content

Commit 51ebd06

Browse files
committed
Updated java-features with lambda and streams
1 parent 9a31680 commit 51ebd06

5 files changed

Lines changed: 570 additions & 212 deletions

File tree

java-features/pom.xml

100644100755
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@
1313
<artifactId>java-features</artifactId>
1414

1515
<properties>
16-
<maven.compiler.source>17</maven.compiler.source>
17-
<maven.compiler.target>17</maven.compiler.target>
16+
<maven.compiler.source>25</maven.compiler.source>
17+
<maven.compiler.target>25</maven.compiler.target>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1919
</properties>
20-
20+
<dependencies>
21+
<dependency>
22+
<groupId>org.jetbrains</groupId>
23+
<artifactId>annotations</artifactId>
24+
<version>13.0</version>
25+
<scope>compile</scope>
26+
</dependency>
27+
</dependencies>
2128

2229

2330
</project>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package dev.javafeatures;
2+
3+
public class IntegerEquality {
4+
public static void main(String[] args) {
5+
int a = 129;
6+
int b = 129;
7+
8+
Integer c = Integer.valueOf("122");
9+
Integer d = 122;
10+
11+
Integer x = 500;
12+
Integer y = 500;
13+
14+
Integer p = 100;
15+
Integer q = 100;
16+
17+
Integer m = 5;
18+
Integer n = Integer.valueOf(5);
19+
20+
if (m.equals(n)) {
21+
System.out.println("Third checking: true");
22+
} else {
23+
System.out.println("Third checking: false");
24+
}
25+
26+
if (m == n) {
27+
System.out.println("Fourth checking: true");
28+
} else {
29+
System.out.println("Fourth checking: false");
30+
}
31+
32+
33+
if (x == y) {
34+
System.out.println("Fifth checking: true");
35+
} else {
36+
System.out.println("Fifth checking: false");
37+
}
38+
39+
if (p == q) {
40+
System.out.println("Sixth checking: true");
41+
} else {
42+
System.out.println("Sixth checking: false");
43+
}
44+
45+
if (d == c) {
46+
System.out.println("Seventh checking: true");
47+
} else {
48+
System.out.println("Seventh checking: false");
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)