Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Java
Expertise: Beginner
Oct 18, 2017



Application Security Testing: An Integral Part of DevOps

Taking Advantage of Immutable Objects in Java

zero = new Integer(0);
return Boolean.valueOf("true");

Integer and Boolean are immutable; so, it is a bad idea to create objects that represent the same value, those classes have built-in caches for frequently used instances. So, the programmer can take advantage of this:

zero = Integer.valueOf(0);
return Boolean.TRUE; 
Octavia Anghel
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



By using this site, you agree to the Privacy Policy
Thanks for your registration, follow us on our social networks to keep up-to-date