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

how do you convert mol dm-3 to gdm-3 and vice versa
Given 4 percent of (2a + b) is 18 and a is a positive integer, what is the greatest possible value of b?
Ho does differentiation change an embryo as it develops
Which Property of Equality should be used first to solve the equation p/7 - 5 = -3 for p Addition Property of Equality Subtraction Property of Equality Multipli
Aside absorbing water and nutrients, what other functions do the roots serve?
Given the volume of a cube is 8 cubic meters, find the distance from any vertex to the center point inside the cube. (A) 1 m (B) √2 m (C) 2√2 m (D) 2√3 m (E) √3
If 5x^2 - 15x = 0 and x ≠ 0, find the value of x. (A) -10 (B) -3 (C) 10 (D) 5 (E) 3
From where did the first novel originate?
What cruel action did macbeth order to insure his status
What is the base of Apothecary