Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Overloaded static methods  RSS feed

 
Abhijit Das
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

I have checked that static methods can be overloaded. But is it helpful? What is problem of overloadding the method.

thanks
abhijit
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37230
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the same as overloading any other method - you can call the same method name with different arguments. Note that static methods cannot be overridden.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To Java (the compiler and the runtime environment), overloaded methods are entirely separate methods, with no relation to each other.

It's like "Jane Doe" and "Jane Smith." They have the same first name, but they are not related.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!