/* Write a java program that has Overloaded Methods. The first method should accept no arguments, the second should accept one string and the third method will accept a string and an integer. The first method should display Delhi is an important city twice.The second method should display the message Bombay is a beautiful city thrice.The third method should display the message Chennai is a peaceful city four times AIM: To demonstrate the usage of method overloading with three different methods of the same name, each accepting different paramaters */ class display { void disp() { System.out.println("Delhi is an important city"); } void disp(String city) { System.out.println("\t"+city+" is a beautiful city"); } void disp(String city,int count) { for(int i=1;i<=count;i++) System.out.println("\t"+city+" is a peaceful city"); } //main public static void main(String args[]) { display obj = new display(); System.out.println("Output when called without parameters"); for(int i=1;i<=2;i++) obj.disp(); System.out.println(); System.out.println("Output when called with 1 string parameter"); for(int i=1;i<=3;i++) obj.disp("Mumbai"); System.out.println(); System.out.println("Output when called with 1 string & 1 integer parameter"); obj.disp("Chennai",4); } }