| Author |
what is the differences of these two?
|
hong Li
Greenhorn
Joined: May 15, 2008
Posts: 4
|
|
|
What is the difference between integer and Interger?
|
 |
Sharon whipple
Ranch Hand
Joined: Jul 31, 2003
Posts: 294
|
|
integer is primitive type Integer is complex type (class) read more here : http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html
|
 |
Marco Ehrentreich
best scout
Bartender
Joined: Mar 07, 2007
Posts: 1220
|
|
Hi hong, I'd say usually Integer (with capital I) is a Java data type for integer numbers and integer (small i) is an integer number in general without any special meaning. That simple Marco
|
 |
Marco Ehrentreich
best scout
Bartender
Joined: Mar 07, 2007
Posts: 1220
|
|
|
@Sharon: The primitive type name is "int" not "integer". That could be confusing for Hong...
|
 |
hong Li
Greenhorn
Joined: May 15, 2008
Posts: 4
|
|
|
thanks guys
|
 |
Rakesh Chaudhary
Ranch Hand
Joined: Feb 19, 2008
Posts: 118
|
|
int is for decalring a primitive data type. whereas Integer is a Wrapper class. There are some classes which take object as there arguments at that time you can use ...Integer ...so that you can wrap a int value in a object and so on.. Please see the java 5.0 autoboxing.. enhancements thanks for i.e int i = 10; (prim) Integer i;(Object..) Thanks hope it helps
|
Acquire the unexpected.......
Preparing for SCJP 6
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: what is the differences of these two?
|
|
|