class Test{
int area(int i){
return i*i;
}
int area(int a, int b){
return a*b;
}
}
public class MethodOverloading {
public static void main(String[] args) {
Test t = new Test();
int area;
area = t.area(5);
System.err.println("Area of a square is :"+area);
area = t.area(5,6);
System.out.println("Area of a rectangle is :"+area);
}
}
int area(int i){
return i*i;
}
int area(int a, int b){
return a*b;
}
}
public class MethodOverloading {
public static void main(String[] args) {
Test t = new Test();
int area;
area = t.area(5);
System.err.println("Area of a square is :"+area);
area = t.area(5,6);
System.out.println("Area of a rectangle is :"+area);
}
}