File tree Expand file tree Collapse file tree
src/main/java/dev/javafeatures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments