Overloading
If you prefer not to always specify the angle of attack for your scary goblin, you can overload your attack method. Isn't that a mean thing to do? No, overloading is having two methods with the same name. Each method, however, must have different parameters. Java calls the method that uses the parameters you specify. For example:
public class Goblin {
public void Attack(int Power) {
code
}
public void Attack(int Power, double Angle) {
code
}
}
If you only specify one parameter, Java calls the first method, but if you specify two parameters, Java calls the second method. However, if you specify one floating point parameter, such as "6.3," the compiler will give you an error.