J
jupiter
I had a case where Long.toString(); in my method compiled and I
could not understand why such behavior. Since the no-arg overload
of toString() is an instance version, the class appeared to be
using the instance version.
???
Dumb gringo had passed an arg to the method named Long. How sweet
is that? When I wrote Long.toString() the compiler was deciding to
use the arg Long, not the wrapper Long.
Dumb dee dumb dumb. Just because it's legal don't mean it's right.
Lingering issue: I'm not sure about the rules of precedence and why
it chose the arg Long instead of the wrapper Long.
Was that story too Long? Maybe I should have tried it with Short.
- Martin Short.
could not understand why such behavior. Since the no-arg overload
of toString() is an instance version, the class appeared to be
using the instance version.
???
Dumb gringo had passed an arg to the method named Long. How sweet
is that? When I wrote Long.toString() the compiler was deciding to
use the arg Long, not the wrapper Long.
Dumb dee dumb dumb. Just because it's legal don't mean it's right.
Lingering issue: I'm not sure about the rules of precedence and why
it chose the arg Long instead of the wrapper Long.
Was that story too Long? Maybe I should have tried it with Short.
- Martin Short.