2.7 Method Overloading & Method Overriding.
Method Overloading : Some operation with different parameters. Example : class Demo1 { void test(int arg) { - } void test(double arg) { - } void test(char arg) { - } } Example Program1 : class Demo1 { void test() { System.out.println("rnning no arg test() method"); } void test(int arg) { System.out.println("rnning int arg test() method"); System.out.println("arg value is"+arg); } void test(double arg) { System.out.println("rnning double arg test() method"); System.out.println("arg value is"+arg); } void test(int arg1, double arg2) { System.out.println("rnning int, double arg test() method"); System.out.println("arg1 value is"+arg1); System.out.println("arg2 value is"+arg2); } } class MainClass1 { public static void main(String args[]) { System.out.println("main method started"); Demo1 d1 = new Demo1(); d1.test(); d1.test(25); d1.test(4.6); d1.test(14, 7.2); System.out.println("program ended...