Method Overloading

PHOTO EMBED

Thu Dec 01 2022 09:39:24 GMT+0000 (Coordinated Universal Time)

Saved by @BaseCaptain #java

class CompileTimePoly {
    // Static polymorphism, Method overloading(same name, same class, diff parameters:- type, number, sequence)

    void method1(int a, int b) {
        System.out.println("1");
    }

    void method1(String a, int b){
        System.out.println("2");
    }

    public static void main(String[] args) {
        CompileTimePoly compileTimePoly = new CompileTimePoly();
        compileTimePoly.method1("hello",5);
    }
}
content_copyCOPY