Loading the catalog…
Loading the catalog…
class A { String f(Object x) { return "1"; } String g() { return f("a"); } } class B extends A { String f(Object x) { return "2"; } String f(String x) { return "3"; } } public class Main { public static void main(String[] args) { A a = new B(); System.out.println(a.g()); } } - 오버로딩(Overloading) 선택: 컴파일 타임에 참조 클래스(A)를 기준으로 메서드 형태(f(Object))를 결정함 (정적 바인딩) - 오버라이딩(Overriding) 실행: 런타임에 실제 인스턴스(B)의 오버라이딩된 메서드(f(Object))를 실행함 (동적 바인딩)
What RADAR observed and classified to build this opportunity. It is what the source published, not a verification that the offer is still active.
[Java] 오버로딩, 오버라이딩. class A { String f(Object x) { return "1"; } String g() { return f("a"); } } class B extends A { String f(Object x) { return "2"; } String f(String x) { return "3"; } } public class Main { public static void main(String[] args) { A a = new B(); System.out.println(a.g()); } } - 오버로딩(Overloading) 선택: 컴파일 타임에 참조 클래스(A)를 기준으로 메서드 형태(f(Object))를 결정함 (정적 바인딩) - 오버라이딩(Overriding) 실행:…
Open sourceOpens an external website. Availability and terms may change.