Re: Integer vs. Number vs int
Re: Integer vs. Number vs int
- Subject: Re: Integer vs. Number vs int
- From: Ricardo Strausz <email@hidden>
- Date: Fri, 28 Nov 2003 12:19:26 -0600
try
public Number tempNum = new Integer(1);
Number is an abstract class from which Integer inherits, so it has to
be "constructed" (in ObjC we say *alloced and inicialzied*) from the
class object. On the other hand, int (while it is supposed to be an
object in Java) is more as a data-type; it can be used without any
constructor method.
Suerte!
Dino
On Nov 27, 2003, at 5:08, 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.