In Java: only for clean code, nice API. In some other languages it is used for "multimethods".
The best example for this is System.out.println method which accepts String,Boolean,Double, Object etc. as a developer how do you feel if you have to call differtent method for different type for example if no overliading then above would be System.out.printString,System.out.printBoolean etc.. hope you have got your answer
Обсуждают сегодня