Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Wrapper Classes are immutable?

881147Oct 15 2011 — edited Oct 16 2011
Hi guys,

The one artichle i have read it says wrapper classes are immutable and once you assign a value to a variable(wrapper class type) you wont be able to change that value ,also ;
Integer myInt=new Integer(5);
myInt=10;//i change it no problem showed up.also why it says wrapper classes are immutable?
//how the java works at the background and change it for us what methods does it use to change the value?
//why java made wrapper classes as immutable?
Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 13 2011
Added on Oct 15 2011
2 comments
961 views