0
What's the difference between between Integer and int and when is either of them use?
4 odpowiedzi
+ 3
int is a primite data type.
Integer is a class, object.
But have something call wrapp and unwap, calling one for other is possible because it (transform one on another, so same thing).
ATTENTION: calling new Integer(number) is DIFERENT to number. It's because "new" create a new object.
0
int is keyword to define integer in java.
But integer itself is a data type.
0
Collection api and generic<Type> declarations requires Integer instead of int
new Integer(n); is deprecated