Skip to content

Instantly share code, notes, and snippets.

@yuvraj650
Last active August 4, 2022 05:23
Show Gist options
  • Save yuvraj650/dec3e8b21ae4196c25c6b217ca5ec5c6 to your computer and use it in GitHub Desktop.
Save yuvraj650/dec3e8b21ae4196c25c6b217ca5ec5c6 to your computer and use it in GitHub Desktop.
Method OVERLOADING Ser
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);
}
}
@yuvraj650
Copy link
Author

Example of Overloading in JAVA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment