Recently I posted a poll on LinkedIn about method selection in overloaded method calls and was rather surprised that only 20% of the answers were correct. That gave me a push to do this write-up, as I feel that same-named methods do not get the credit they deserve for the mess they can cause.

I plan to make this a three-part article. This part will look purely at method overloading within a single type definition (class, interface, or enum). Basically, we going to look into how most specific method is selected by only looking at methods arguments. Part two will cover overloading with generics. Part three will examine the complexities beyond the single-type case, such as inheritance, polymorphism, and method hiding.

Throughout this article, I am not going to get into the differen…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help