Well, that's cause you said "integer", and not "int"
like wingedpanther said, int is a primitive class.
All classes in Java that do not start with a capital letter are primitive and thus "special".
It's a short list of types: int, short, float, double, byte, boolean, char.
Every other class will, or should have, a capital letter to begin with: String, Integer, ...
Every primitive type has a wrapper class which does start with a capital letter and is written fully : Integer, Float, Double, Byte, Boolean, Character;
Now what's so special about a class vs a primitive type is that a class ALWAYS extends the Object class. Also the classes you create yourselves.
What you're trying to do there with the int is, no offense, stupid. As when you declare something as "int", why check whether it's an int?

It is useful as all the normal classes can be upcasted and downcasted, and handled as another class while they are actually another class.
String str = "hi";
Integer number = new Integer(8);
Object o1 = str;
Object o2 = number;
So when you're now dealing with o1, and o2. All you know as programmer is that those are from the Object class, they could however really be another class.
That you can check using instanceOf
if(o1 instanceof String){
//String
} else if (o1 instanceof Integer){
//Integer
}
Now the thing is, an int, byte, double,.... can't be declared as somehting else
int i = 5;
Object o1 = i;
That code won't compile.
So you can't declare an int as anything else but an int. So when you got an int, you know it. There's no way you declare something differently and it turns out to be an int.
(It can be an Integer tho)
I hope it's somewhat more clear

Ask ahead.
Edit: interesting, well explained, upcasting downcasting tut:
http://forum.codecal...owncasting.html