<h1>When inheriting</h1>
A good example is when you want to alter the default behavior of a class by inheriting it, and particularly when you have something similar to the [**template method**][1] pattern, where you have each step of some algorithm implemented in a method.

Imagine that you have `class Robot` and a method called `fireAtTarget(Target target)`... which calls `fireWeaponA(target); fireWeaponB(target); fireWeaponC(target);` one after each other. You also want to have a collection called robot_army to which you can only add objects of the class Robot. Robot fires machine guns by default in its `fireWeaponX()` methods.

Then you want to have `class LazorRobot` and `class MissileRobot`, do you implement Robot all over again?, no, just have LazorRobot and MissileRobot inherit Robot, and **overload** each `fireWeaponX()` method to use lazorz or missiles and you will have the same behavior with different weapons, without having to reimplement the rest of the methods.

tl;dr: To have the method's behavior depend on the class without breaking the interface (robot_army only accepts Robot, but accepts by extension any classes that inherit Robot).

<h1>When not inheriting</h1>

You can also overload without inheriting (within the same class) to have the parameters of the method dictate how the method will behave.

A quick example would be:

 class Calc{
 //...
 public int sum(int a, int b){
 return a+b;
 }
 public double sum(double a, double b){
 return a+b;
 }
 //...
 }

If you pass the method sum(a,b) a couple of integers it knows that it should call the first implementation, since the method call coincides with the method signature (i.e. double sum(double,double) will not work if you give the sum method two integers).

The signature of the call must match the available implementations, so trying to call sum(string, string) will not work unless you have this:

 class Calc{
 //...
 public int sum(int a, int b){
 return a+b;
 }
 public double sum(double a, double b){
 return a+b;
 }
 public string sum(String a, String b){
 return "" + (Double.parseDouble(a) + Double.parseDouble(b));
 }
 //...
 }

tl;dr: To have the class handle the correct method according to whatever parameters you give a method with the same name. 

 [1]: http://en.wikipedia.org/wiki/Template_method_pattern