Re: Integer vs. Number vs int
Re: Integer vs. Number vs int
- Subject: Re: Integer vs. Number vs int
- From: Michael Halliday <email@hidden>
- Date: Thu, 27 Nov 2003 08:19:13 -0500
The Java Number class is an abstract class and cannot be instantiated.
public Integer tempNum = new Integer(1);
should work. Or you could simple use the primitive int value such as
this.
public int tempNum = 1;
Check out the java documentation and the Number class.
Michael.
On 27-Nov-03, at 6:08 AM, Drew Thoeni wrote:
I am trying to put a numeric value into an Number object using:
public Number tempNum = 1;
But I get "incompatible types" on compile.
I'm new to Java but this seems analogous to the Java
public String tempString = "abc";
Which compiles fine.
I get the same "incompatible types" with:
public Integer tempNum = 1;
What am I missing?
Drew
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.