Katmcfee483 Katmcfee483
  • 14-09-2019
  • Computers and Technology
contestada

Why is String final in Java?

Respuesta :

ExieFansler ExieFansler
  • 17-09-2019

Answer:

string objects are cached in string pool.

Explanation:

Strings in Java are immutable or final because the string objects are cached in String Pool.As we know multiple clients share the string literals so there exists a risk of one client's action affecting all other clients.

For ex:-The value of string is "Roast" and client changed it to "ROAST" so all other clients will see ROAST instead of Roast.

Answer Link

Otras preguntas

100 POINTS PLEASE AND THANK YOU ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
can someone tell me some websites for programing in C++ who are free​
somebody please help meeeee pt.2​
can someone please help me with this standard form [tex]5 \times 10 {}^{4 } \times 2 \times 10 {}^{ - 6} [/tex]can u also show me how to do it step by step ple
Mr. Roshan will buy 12.5lbs of beef . the price for the first 3 pounds are 4.99 . after that, the price is 4.49per pound how much will he pay?
Mr. Roshan will buy 12.5lbs of beef . the price for the first 3 pounds are 4.99 . after that, the price is 4.49per pound how much will he pay?
Urgent please help only num 2
A convex pentagon has an interior angle with measures (5x-12),(2x+100),(4x+16),(6x+15),(3x+41) find the x value
which is the rational number that is neither a positive nor negative?​
I need help! Algebra and Equations.