Advertisement
Krzysztof1985

Integer test

Feb 4th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. package pl.selfimproveit;
  2.  
  3. public class IntegerTest {
  4.  
  5.     public static void main(String[] args) {
  6.    
  7.         Integer a = 134;
  8.         Integer b = 134;
  9.  
  10.         if (a == b) System.out.println("The same object! - test 1");
  11.         if (a.equals(b)) System.out.println("Equals values -test 1");
  12.        
  13.         Integer c = 12;
  14.         Integer d = 12;
  15.  
  16.         if (c == d) System.out.println("The same object! - test 2");
  17.         if (c.equals(d)) System.out.println("Equals values - test 2");
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement