Shared Tutorials
Tutorials Shared by the Internet Community
Advertisements
| Top Tutorials | New Tutorials | Submit | Login | Register |
Tutorial Basic Detail
Why String is immutable in Java
http://javarevisited.blogspot.com/2010/10/why-string-is-immutable-in-java.html
Total Hits: 6663
Total Votes: 49 votes
Average Rating: 3.53 out of 5
Category: Computer Basics/Computer Basics
Description:
This is one of the most popular interview question on String in Java which starts with discussion of What is immutable object , what are the benefits of immutable object , why do you use it and which scenarios do you use it.It can also come once interviewee answers some preliminarily strings questions e.g. What is String pool , What is the difference between String and StringBuffer , What is the difference between StringBuffer and StringBuilder etc.
Though there could be many possible answer for this question and only designer of String class can answer this , I think below two does make sense
Rating Detail
| Stars | Percentage | Total Vote |
|---|---|---|
![]() |
![]() ![]() 16.33% |
8 |
![]() ![]() |
![]() ![]() 16.33% |
8 |
![]() ![]() ![]() |
![]() ![]() 16.33% |
8 |
![]() ![]() ![]() ![]() |
![]() ![]() 18.37% |
9 |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() 16.33% |
8 |





16.33%

16.33%

16.33%

18.37%

16.33%