---
title: "Example of Method overloading in java?"  
description: "Example of Method overloading in java?"  
author: "Anonymous User"  
published: 2014-10-10  
updated: 2014-10-10  
canonical: https://www.mindstick.com/forum/2354/example-of-method-overloading-in-java  
category: "java"  
tags: ["java", "oops"]  
reading_time: 1 minute  

---

# Example of Method overloading in java?

[method overloading](https://www.mindstick.com/forum/127/method-overloading) in [java](https://www.mindstick.com/articles/12214/web-development-company-in-india-laid-on-the-foundation-of-concrete-java-programming)

## Replies

### Reply by Anonymous User

try this:

```
public int Sum(int a, int b)        {            return a + b;        }         public double Sum(double a, double b)        {            return a + b;        }        public int Sum(int a, int b)        {            return Sum(a, b, 0);        }         public int Sum(int a, int b, int c)        {            return a + b + c;        }
```


---

Original Source: https://www.mindstick.com/forum/2354/example-of-method-overloading-in-java

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
