The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

int is not the same as Integer

Posted by ping203 on January 16, 2002 at 10:32 AM

In Java, Integer is different from int.
Integer is a class while int is a primitive type.
Since they are different types, that's why you get the incompatible type error when you assign an int type to an Integer type.

And in your case, I guess it is better off to use int(or float) than Integer.

Ping



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us