Question DSA-STR-0052
MediumWhy are strings immutable in Java and Python?
- A.
Safe sharing, caching of hash codes and use as dictionary keys
- B.
To save typing
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Strings question
Why are strings immutable in Java and Python?
Safe sharing, caching of hash codes and use as dictionary keys
To save typing
Sign up free to see the answer and a step-by-step explanation.
To allow multiple inheritance
Because they are stored on disk