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..




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();


The only remaining exception would be if your class was itself a subclass of Long. Then and only then would your usage work as shown.

Mike Hall        mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



_______________________________________________
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>)



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.