top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Why we don't have Integer pool like String we have in Java?

+2 votes
42 views
Why we don't have Integer pool like String we have in Java?
posted Sep 10, 2015 by Yogeshwar Thakur

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Not very sure about your question related to Integer and String pool however
if you use Integer.valueOf methods, you will get cached/common instance for same value used multiple times.

Which means this implicitly creates a pool of commonly used values.

http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#valueOf(int)

answer Sep 10, 2015 by Rahul Jha
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...