From fc1a084faded19f53d0a8be4558d1da02c526e1b Mon Sep 17 00:00:00 2001 From: Serkan HELVACIOGLU Date: Thu, 5 Oct 2017 17:42:29 +0300 Subject: [PATCH] Overloading Example Overloading Example with Java --- Overloading.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Overloading.java diff --git a/Overloading.java b/Overloading.java new file mode 100644 index 0000000..39cb562 --- /dev/null +++ b/Overloading.java @@ -0,0 +1,26 @@ +package pack1; + +public class OverloadingExample { + + + + public void calculation(int x){ + System.out.println("The Result: "+(x*x)); + } + + public void calculation(int x,int y){ + System.out.println("The Result: "+(x*y)); + } + + + + + public static void main(String[] args) { + OverloadingExample obj1 = new OverloadingExample(); + obj1.calculation(5); + obj1.calculation(7, 2); + + + } + +}