Although Java programming language is an object-oriented language, in a lot of cases that you would need to deal with primitive types. Before J2SE 5.0, working with primitive types required the repetitive work of conversion between the primitive types and their wrapper classes. In this FAQ, you will see how the new autoboxing feature in J2SE 5.0 handles conversions -- for example, between values of type int and values of type Integer . For example, class Program { public static void main(String[] args) { Integer i1 = 20; Integer i2 = 20; Integer i3 = 201; Integer i4 = 201; System.out.println(i1 == i2); System.out.println(i3 == i4); } } The output is true false What we have discovered is that for small integral values, the objects are cached in a pool much like String pool.
About Java and it's related concepts..