Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Why String has been made immutable in Java?

Why String has been made immutable in Java?Though, performance is also a reason (assuming you are already aware of the internal String pool maintained for making sure that the same String object is used more than once without having to create/re-claim it those many times), but the main reason why String has been made immutable in Java is 'Security'. Surprised? Let's understand why.Suppose you



This post first appeared on Geek Explains: Java, J2EE, Oracle, Puzzles, And Problem Solving!, please read the originial post: here

Share the post

Why String has been made immutable in Java?

×

Subscribe to Geek Explains: Java, J2ee, Oracle, Puzzles, And Problem Solving!

Get updates delivered right to your inbox!

Thank you for your subscription

×