Overloading : 重載
函式的簽名包括:參數的數量和類型,const屬性,甚至參數的順序。當編譯器發現存在一個以上的具有相同名字的函式,它就會調用其中一個匹配的函式。java語言支持函式返回值的不同。
Overloading:
Signature has to be different. Just a difference in return type is not enough.Accessibility may vary freely.Exception list may vary freely.Just the name is reused. Methods are independent methods. Resolved at compile-time based on method signature.Can call each other by providing appropriate argument list.