Fidelity Investments interview question

Difference between int and Integer in Java. (Phone screen question)

Interview Answer

Anonymous

Nov 24, 2014

int is a primitive type value and a variable declared as int type is immutable where is Integer on the other hand belongs to Object class and we can call methods on a variable of Integer type. eg: int i; Integer j; String s = i.toString(); //fails String s = j.toString(); //works