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

What is the factorization of 729x15 1000? (9x5 10)(81x10 – 90x5 100) (9x5 10)(81x5 – 90x10 100) (9x3 10)(81x6 – 90x6 100) (9x3 10)(81x9 – 90x3 100).
True or false1.) Schizophrenia is a chronic brain disorder.2.) Mental Health is important because it affects how we think, feel, and act as we cope with life.3.
Do you think this village is similar to or different from how most of the colonies viewed independence?
What is the importance of the Missouri Compromise
A pair of numbers that has the sum of 12 and a difference of eight
hi how do add in math
A magic 8-ball has a diameter of 5 inches. It is filled 85% full with blue water. How much space is occupied by the water?
I KNOW ITS NOT D BUT I NEED HELP Which sentence best states the main idea of this passage from Roosevelt's Four Freedoms speech? A. We are in an emergency situa
B. On a separate sheet of paper, describe the different ways of generating electric power. ​
Help me I’ll give brainly please