컴퓨터활용/java interview 썸네일형 리스트형 method overloading Vs overriding 질문 : 다음 코드를 수행하면 결과는? 1 2 34567891011121314151617181920212223242526272829public class Temp { public boolean equals( Temp other ) { System.out.println("Here is Temp equals method" ); return this == other; } public static void main(String[] args) { Object o1 = new Temp(); Object o2 = new Temp(); Temp o3 = new Temp(); Temp o4 = new Temp(); if(o1.equals(o2)){ System.out.println("objects o1 and o2 ar.. 더보기 String Compare equals Vs == 질문 : 다음 코드를 수행하면 결과는? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19public static void main(String[] args) { String s1 = new String("Hello"); String s2 = new String("Hello"); if(s1 == s2) { System.out.println("s1 and s2 are =="); } else if (s1.equals(s2)) { System.out.println("s1 and s2 are equals()"); } String s3 = "Hello"; String s4 = "Hello"; if(s3 == s4) { System.out.println("s3 and s4 are .. 더보기 이전 1 다음