Input
Output
public class Methodoverloading{ public static void main(String args[]) { A a=new A(); a.show(5); a.show(5,7); } } class A { void show(int a) { System.out.println("Area of square: "+(a*a)); } void show(int a, int b) { System.out.println("Area of Rectangle: "+(a*b)); } }