Created
May 4, 2012 08:29
-
-
Save dezgeg/2593304 to your computer and use it in GitHub Desktop.
Java, Integer ja yhtäsuuruudet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmtynkky@melkki:~$ cat Test.java | |
public class Test | |
{ | |
public static void main(String[] args) | |
{ | |
for(int i = 120; i < 140; i++) | |
{ | |
Integer j1 = i; | |
Integer j2 = i; | |
if(j1 == j2) | |
System.out.println(i + " == " + i); | |
else | |
System.out.println(i + " != " + i); | |
} | |
} | |
} | |
tmtynkky@melkki:~$ java Test | |
120 == 120 | |
121 == 121 | |
122 == 122 | |
123 == 123 | |
124 == 124 | |
125 == 125 | |
126 == 126 | |
127 == 127 | |
128 != 128 | |
129 != 129 | |
130 != 130 | |
131 != 131 | |
132 != 132 | |
133 != 133 | |
134 != 134 | |
135 != 135 | |
136 != 136 | |
137 != 137 | |
138 != 138 | |
139 != 139 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment