fork download
  1. public class Main {
  2. public static void main(String[] args) {
  3. Integer a = 10, b = 10;
  4. Integer c = 150, d = 150;
  5. //равенство ссылок
  6. System.out.println(a == b);
  7. System.out.println(c == d);
  8. //равенство значений
  9. System.out.println(a.equals(b));
  10. System.out.println(c.equals(d));
  11. }
  12. }
Success #stdin #stdout 0.02s 245632KB
stdin
Standard input is empty
stdout
true
false
true
true