Why String Is immutable? | Core Java Interview question

preview_player
Показать описание
Why string is immutable in java is explained in this video. why strings are immutable in java.
Java interview questions
Java programming tutorial
Java programming for beginners
Java tutorial for beginners
Java tutorial

How hashmap works internally in java

Video for difference between Method overloading and Method Overriding
Or
Video for difference between Compile time polymorphism and runtime polymorphism
Video for Inheritance Vs Association & Aggregation Vs Composition

Video for difference between JDK, JVM and JRE

Video for Object Oriented Programming Part 1

Video for Object Oriented Programming Part 1

Why String in Immutable?

Video for Coupling and Cohesion

Video for Differenace between String, StringBuffer and StringBuilder in java

Using Generics In Collection

Introduction to collection framework

Difference Between ArrayList And LinkedList

How HashMap works internally

Difference Between HashSet, LinkedHashSet and TreeSet
Рекомендации по теме
Комментарии
Автор

As per our immutable concept string value didnt change but here java in memory not change to wave, but in program why it is give op wave, I mean it didnt show any error

korebhagath
Автор

Simple and clear explanation. Been searching for a clear explanation and finally got one. Thanks.

lakshnarayanan
Автор

Did we really get the answer? From the POV of a language designer, the only answer to why strings are immutable came at the very end. They are useful as keys for hashmaps and safer while multi threading. The heap stuff is the answer to “Given you decided to make strings immutable in your language, how can you reduce the load on memory?”

dillonmrose
Автор

String has nothing to do with hashmap key, hashmap works in a different way and determine uniqueness by hashcode of the key. Also not suitable for use to store password since it'll stay in string pool. Learn more.

sabyasachimukherjee
Автор

How string is secure the username and password? Pls elaborate it

knowledgeshare
Автор

After concating Java to Wave, Java Wave is not created in String pool, it is created in heap area, , , , comment me, if I am wrong

akshaykulkarni
Автор

Very good explanation, continue to do more videos.

harishb
Автор

Thank you for explanation! But what is intern() method?

FabiaNightshadow
Автор

Nice explanation...can you give an example of how string immutability helps in security of database Configurations or URLs ?

rajeshranjan
Автор

Very clear 👍.. but please elaborate on security aspect

custardapple
Автор

I need hash map internal mechanism with example in the above same way mam

rameshc