Overloading Methods and Constructors
One very interesting property of Java is how it allows you to define methods that have the same conceptual functionality as each other by using the same name but changing either the type or number of parameters. Let's see how this could work.
class Age { public double a = 0; public void setAge ( double _a ) { a = _a; } public void setAge ( int year, int month ) { a = year + (double) month / 12; } public double getAge () { return a; } } class Example09 { public static void main(String[] args) { Age age = new Age(); ...