As said by shailley
But when you create Objects using the new() then
they are never pooled as the same as Strings.
But when we use new keyword,
Java will create a new String object
in normal (non-pool) memory, and s will refer to it. In addition, the string literal will be placed in the pool.
I guess that is same for Integer also. Plz correct me if I am wrong