Re: Number
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>) |