Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Errr..



Michael Hall wrote:
>
> On Jan 12, 2006, at 5:15 PM, Bob Irving wrote:
>
>>> From  the java.lang API...
>>
>
> java.lang is a package not a class.
>
>> public static String toString(long i)
>>
>
> I assume the Class API you mean is for Long
> then you want
> Long.toString(orderID);
>
> The static indicates this is a class method, which can be invoked
> without obtaining a actual instance by prefixing the class name.
> Otherwise, for a instance method, you would need something like
> Long l = new Long();
> long whatever = l.toString();

Could you elaborate on those two lines please?

Where in the API of java.lang.Long would one expect a long return value
from a .toString() method call? I would imagine the types are
incompatible.

Also, I was not aware of a constructor for Long with no arguments. I
realise you stated "something like" in regards to these two lines of code,
but if you're going to get picky about someone talking about the API of a
package, then it wouldn't hurt to get simple code correct.

Matt

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Re: Java Swing and Quartz (From: Brian Foster <email@hidden>)
 >Errr.. (From: Bob Irving <email@hidden>)
 >Re: Errr.. (From: Michael Hall <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.