"What are the differences between Integer and Int?"
An integer is just an alias for java.lang.Integer. Int is a Scala integer with additional capabilities.
Looking in Predef.scala, you can see this alias:
/** @deprecated use <code>java.lang.Integer</code> instead */ @deprecated type Integer = java.lang.Integer
However, there is an implicit conversion from Int to java.lang.Integer if you need it, which means you can use Int in methods that accept Integer.
As to why it is deprecated, I can only assume that this was to avoid confusion regarding the type of whole you were working with.
Richard Dallaway Aug 13 '09 at 13:34 2009-08-13 13:34
source share