compile time polyphorism

PHOTO EMBED

Tue Jan 09 2024 01:03:21 GMT+0000 (Coordinated Universal Time)

Saved by @E23CSEU1151 #java

class A
{  
    void C()
    {
        int a=20; int b=30; int c;
        c=a+b;
        System.out.println(c);
    }
    void C(int x,int y)
    {
        int c;
        c=x+y;
        System.out.println(c);
    }
    void C(int x,double y)
    {
        double c;
        c=x+y;
        System.out.println(c);
    }
    public static void main(String[] args)
    {
        A r= new A();
        r.C();
        r.C(10,20);
        r.C(11,22.33);
    }

}
content_copyCOPY