Each time you convert a value of 1000 into an object wrapper a new Integer instance is created. Therefore, first comparison will result in false.
Note: For values from -128 to 127 an object will be taken from the pool of Integers, and result of comparison will be true.
If the == operation compares primitives and object wrappers, then object wrappers are converted into primitives. Therefore, second comparison will result in true.