Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Long story

Reply
Thread Tools

Long story

 
 
jupiter
Guest
Posts: n/a
 
      12-28-2006
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.


 
Reply With Quote
 
 
 
 
Daniel Pitts
Guest
Posts: n/a
 
      12-28-2006

jupiter wrote:
> 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.


Funny story, although the term gringo is a little offensive.

Better than BigInteger Story

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to (const __gnu_cxx::hash<long long int>) (const long long int&) veryhotsausage C++ 1 07-04-2008 05:41 PM
Tell Your Story - Wondershare Released Photo Story Platinum kena Digital Photography 0 06-12-2007 08:42 AM
unsigned long long int to long double Daniel Rudy C Programming 5 09-20-2005 02:37 AM
Newsweek Story just that a Story Mark Test Digital Photography 21 05-22-2005 02:39 PM
Assigning unsigned long to unsigned long long George Marsaglia C Programming 1 07-08-2003 05:16 PM



Advertisments