Strings are Immutable in Java

  Рет қаралды 79,221

Neso Academy

Neso Academy

Күн бұрын

Java Programming: Strings are Immutable in Java Programming
Topics discussed:
1. Immutable Objects in Java.
2. Strings are immutable in Java.
3. Using new with Strings.
Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
Contribute: www.nesoacademy...
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy...
Website ► www.nesoacademy...
Forum ► forum.nesoacad...
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#JavaByNeso #JavaProgramming #StringsAreImmutable

Пікірлер: 53
@Ceyhus
@Ceyhus 4 жыл бұрын
Awesome!!! Finally, someone explained simply what Garbage really is ))) Thank you
@AllAboutCode
@AllAboutCode 2 жыл бұрын
java is garbage
@devendrasinghmeena7407
@devendrasinghmeena7407 4 жыл бұрын
Happy to see you again!
@JavaAidTutorials
@JavaAidTutorials 4 жыл бұрын
*Informative content* 👍👍
@advitiayanand5974
@advitiayanand5974 4 жыл бұрын
Enlightening! Thank you for such an easy to follow explanation.
@buddingscientist170
@buddingscientist170 4 жыл бұрын
Welcome back neso academy
@justpaulo
@justpaulo 4 жыл бұрын
Thank you for clarifying this. I guess I misunderstood you on the last couple of videos and rush to conclusions. My bad.
@telegramvideos1313
@telegramvideos1313 3 жыл бұрын
BEST COURSE EVER!!!
@lamaspacos
@lamaspacos 2 ай бұрын
03:17 We want use «new» for different String variables that point different strings with the same text.
@DeepakKumar-dw1re
@DeepakKumar-dw1re 2 жыл бұрын
Btw your explanation is too good. Thanks for giving such an adorble content.
@chukwukennedy7035
@chukwukennedy7035 11 ай бұрын
thank you for this resource you created, its self explanatory.
@jorgeflores7278
@jorgeflores7278 3 жыл бұрын
great explanation!
@mayankbhatt9777
@mayankbhatt9777 4 жыл бұрын
awesome expainition
@JunaidKhan-ri5ev
@JunaidKhan-ri5ev 4 жыл бұрын
Quite helpful 🙂
@codingwithjava7297
@codingwithjava7297 4 жыл бұрын
Sir please make a playlist on servlet and jsp
@belanrzgar1414
@belanrzgar1414 4 жыл бұрын
Love you🤭 thank you 💛
@sajjadabdulaziz6178
@sajjadabdulaziz6178 4 жыл бұрын
thank you bro
@dipeshsamrawat7957
@dipeshsamrawat7957 2 жыл бұрын
I love you Neso Academy. ❤️
@rrbofficer
@rrbofficer 4 жыл бұрын
Please upload java videos everyday.
@MajesticQT
@MajesticQT 2 жыл бұрын
Thanks!
@mdfaisal408
@mdfaisal408 4 жыл бұрын
Welcome back❤️❤️❤️
@ma8969
@ma8969 2 жыл бұрын
thanks
@kenjohnsiosan9707
@kenjohnsiosan9707 2 жыл бұрын
thank you sir
@balakrishnaprasad8928
@balakrishnaprasad8928 4 жыл бұрын
Sir App release date??
@divyaagarwal3091
@divyaagarwal3091 2 жыл бұрын
Thankyou sir 😊
@DolaLado
@DolaLado 4 жыл бұрын
Welcome back
@bahram-848durani2
@bahram-848durani2 Жыл бұрын
Great!!!
@user-zq2pe3gw3f
@user-zq2pe3gw3f 4 жыл бұрын
Strings are immutable its value cannot changed but how it changed when we concatenate it with other string pls explain with reference address box
@adityaghadge3957
@adityaghadge3957 4 жыл бұрын
Ya same doubt 🤔 please answer it !!!
@ManiKandan-vo2qr
@ManiKandan-vo2qr 4 жыл бұрын
@@adityaghadge3957 : A separate object will be created in the string constant pool whose reference is pointed to it . But u can see the old value remains the same in the memory . It means it is not over ridden. So since that value is not overridden it is immutable .
@waxylayer8353
@waxylayer8353 3 жыл бұрын
When S1 = "hello" , in the string pool a value hello would be created and S1 will point to it. When S1.concat("world") is done and when you print S1 you would get the output as hello only and not as helloworld, when u do S1 = S1.concat("world"); and print S1, now you will get the output as helloworld because the value helloworld would be newly created in the string pool and S1 would point to that and not hello value anymore due to the equal sign (=). But even when you modify it like this .. the hello is not editted it's in the same place or memory . We just created a new value in new place or memory .. and pointed S1 to it. So the hello would be removed by Garbage collector automatically if it's not been used. This Garbage collection is done by jvm itself
@hetaeramancer
@hetaeramancer 3 жыл бұрын
@@ManiKandan-vo2qr that seems inefficient memory-wise. can we erase that old value from memory?
@suswithcherry9252
@suswithcherry9252 8 ай бұрын
@@hetaeramancer GC will automatically does that work
@brunomiguel6603
@brunomiguel6603 Жыл бұрын
It's clear , and how about prinitives data type ? Are Java primitives immutable?
@RakataRakata1010
@RakataRakata1010 11 ай бұрын
no, if you assign a new value to an integer, the previous value will be overwritten and you will store the new value in the integer
@paia6447
@paia6447 2 жыл бұрын
Hey sir, String and constant are similar right, they cannot be change
@AbhishekKumar-ll4rr
@AbhishekKumar-ll4rr 4 жыл бұрын
GC is not applicable for string constant pool
@user-zq2pe3gw3f
@user-zq2pe3gw3f 4 жыл бұрын
Str1='val'; Str='val2'; What happened when same name of string object have different value explain with reference diagram(like 3.58 th minute in this video)
@kosisraj
@kosisraj 4 жыл бұрын
Strings are immutable in java. So, you can not hold different values on the same name of the string.
@divyanshubhargava3480
@divyanshubhargava3480 2 жыл бұрын
wallah habibi come to dubai
@rizwansayyed7893
@rizwansayyed7893 2 жыл бұрын
you said strings can be collected by GC but its not the case when i searched on internet it says jvm does not allow GC to run in strings pool , can yo elaborate on this?
@rajeshprajapati6662
@rajeshprajapati6662 Жыл бұрын
That is incorrect.
@rajeshprajapati6662
@rajeshprajapati6662 Жыл бұрын
Read - When will a string be garbage collected in java ? on Stackoverflow.
@rizwansayyed7893
@rizwansayyed7893 Жыл бұрын
@@rajeshprajapati6662 can you provide some links ?
@tamillenin2276
@tamillenin2276 4 жыл бұрын
100th like 😄🥳💥
@aakashpoly
@aakashpoly 3 жыл бұрын
I think old value is not removed by Java Garbage Collector in the String Literal.
@rocknroll_4741
@rocknroll_4741 4 жыл бұрын
String bhot easy h
@ShahNawaz-cx3pi
@ShahNawaz-cx3pi 4 жыл бұрын
Data structures in C????
@rajnandanipuri2895
@rajnandanipuri2895 3 ай бұрын
Alrrrrrrrright😂👍🏻
@royankit126
@royankit126 2 жыл бұрын
String is stored in String Constant Pool and java garbage collector can not remove the value stored in String Constant Pool
@AbhishekVerma-gm8hr
@AbhishekVerma-gm8hr 2 жыл бұрын
russian teacher h kya
@abhishekchoudhary8023
@abhishekchoudhary8023 3 ай бұрын
😂
@ChiemerieNNAMANI767
@ChiemerieNNAMANI767 11 ай бұрын
JAVA Garbage collector 🤣🤣🤣😅 Is that a real thing?
The Scanner Class in Java
6:33
Neso Academy
Рет қаралды 264 М.
Primitive Types and Reference Types in Java
6:28
Neso Academy
Рет қаралды 135 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,1 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 5 МЛН
Girl, dig gently, or it will leak out soon.#funny #cute #comedy
00:17
Funny daughter's daily life
Рет қаралды 27 МЛН
Java Strings are Immutable - Here's What That Actually Means
7:06
Coding with John
Рет қаралды 614 М.
ArrayLists in Java (Part 1)
10:59
Neso Academy
Рет қаралды 102 М.
Calling String Methods in Java
10:34
Neso Academy
Рет қаралды 90 М.
Java OOP in 10 Minutes (Java Object Oriented Programming) #95
10:05
.equals() vs. == in Java - The Real Difference
8:48
Coding with John
Рет қаралды 187 М.
Why string is immutable in java || The 4 reasons you must know || part 1
20:53
Java methods 📞
11:05
Bro Code
Рет қаралды 132 М.
Why String is Immutable and Final in Java?
19:59
Naveen AutomationLabs
Рет қаралды 88 М.
String Immutable In Java Interview Question
9:47
Naveen AutomationLabs
Рет қаралды 20 М.
#34 What is String in Java
7:24
Telusko
Рет қаралды 129 М.
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 3,1 МЛН