Last active
August 4, 2022 05:23
-
-
Save yuvraj650/dec3e8b21ae4196c25c6b217ca5ec5c6 to your computer and use it in GitHub Desktop.
Method OVERLOADING Ser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yuvrajworld; | |
class A | |
{ | |
public void f1(int x) | |
{ | |
System.out.println("class A"); | |
} | |
} | |
class B extends A | |
{ | |
public void f1(int x, int y) | |
{ | |
System.out.println("Class B"); | |
} | |
} | |
public class Main | |
{ | |
public static void main (String[]args) | |
{ | |
B obj = new B(); | |
obj.f1(1); | |
obj.f1(2,3); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example of Overloading in JAVA