• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number


  • Subject: Re: Number
  • From: Wolfram Stebel <email@hidden>
  • Date: Tue, 21 Feb 2006 11:37:19 +0100
  • Thread-topic: Number

Am 21.02.2006 11:08 Uhr schrieb "Jim Wong" unter <email@hidden>:

> Hi:
>
> In java and C++, there's the ++, += operations. But in WO, when i
> have a data type :
>
> public Number tmpCode
>
> how can i use tmpCode for things like tmpCode += 1; or tmpCode++ etc?
You can't.
Number is an Object and immutable.
You can do things like:

Number n = new Integer ( tmpCode.intValue () + 1 );

or better:

int i = tmpCode.intValue ();
... calculate something...

i++; i--; i=i*i;

... calculated something...
tmpCode = new Integer ( i );

You should have a look into the java tutorials.

Regards
>
>
>
> Warmest Regards,
> Jim Wong
> email@hidden


Wolfram


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Number (From: Jim Wong <email@hidden>)

  • Prev by Date: Number
  • Next by Date: Instance numbers in WSDL
  • Previous by thread: Number
  • Next by thread: Re: Number
  • Index(es):
    • Date
    • Thread