+ 4

Why string in java is final

Java

27th Feb 2019, 9:19 AM
Rahul
Rahul - avatar
6 Answers
+ 15
So that it cannot be changed?
27th Feb 2019, 9:37 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 3
To make it a constant.
28th Feb 2019, 1:30 AM
Sonic
Sonic - avatar
+ 2
since it is immutable object it is stored in string constant pool
28th Feb 2019, 8:52 AM
sree harsha
sree harsha - avatar
+ 2
String is an object somewhere in the memory. String name - is a link to the object.
2nd Mar 2019, 8:56 AM
M_N