Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AakashCode12/b44f8e41971d50d09563f060eef48635 to your computer and use it in GitHub Desktop.
Save AakashCode12/b44f8e41971d50d09563f060eef48635 to your computer and use it in GitHub Desktop.
class addition
{
public void add(int x,int y)
{
System.out.println(x+y);
}
public void add(double x, double y)
{
System.out.println(x+y);
}
}
class method_overload
{
public static void main(String args[])
{
addition obj = new addition();
obj.add(7,5);
obj.add(10.2,10.4);
}
}
//C:\Program Files\Java\jdk-14.0.1\bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment