How Method Overloading Helping in Java - Part 9
I'm sharing my experience with you as these are the questions which have been asked to me while interviewing on java profile. Where have u observed method overloading helped us in java? Where have you seen in java default classes using method overloading? We need method overloading because if we have multiple arguments for add method and we have to create multiple methods in that case we will be confused which method to call to perform specific addition. Example: class PrintOverloading1 { public void show( char c) { System . out .println(c); } public void show( char c, int number) { System . out .println(c + " " + number); } public void show( char c, String s ) { System . out .println(c + " " + s); } } class demo1 { public static void main( String args[]) { PrintOverloading1 obj = new PrintOv