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: Integer vs. Number vs int



Hi Drew

On Thursday, November 27, 2003, at 11: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";

There is no boxing in Java. You need to convert explicitely between native and object types. The String example works because "abc" is a String object, it is not a native type. There is no native type for strings.


Cheers,
-- Denis.


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.

References: 
 >Integer vs. Number vs int (From: Drew Thoeni <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.