Created
August 4, 2020 11:57
-
-
Save AakashCode12/b44f8e41971d50d09563f060eef48635 to your computer and use it in GitHub Desktop.
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
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