Wpis z mikrobloga

public static void main(String[] args) {
StringBuilder sb1 = new StringBuilder("abc");
StringBuilder sb2 = new StringBuilder("abc");
if (sb1 == sb2) {
System.out.print("1");
} else {
System.out.print("2");
}
if (sb1.equals(sb2)) {
System.out.print("1");
} else {
System.out.print("2");
}
}
#java #javapuzzle

Co wypisze

  • 11 16.4% (9)
  • 12 10.9% (6)
  • 21 43.6% (24)
  • 22 29.1% (16)

Oddanych głosów: 55

  • 6
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach