How to Make an Object Immutable in Java | Common Interview Question

preview_player
Показать описание
Learn how to make an immutable object in Java with the final keyword and access modifiers. We'll also look at the Java source code for Strings, which are very frequently used immutable objects. This is a pretty common technical interview question in Java interviews and after watching, you'll know how to answer it!

What to learn how to code during quarantine? Sign up for LinkedIn Learning!

Courses on LinkedIn Learning!

Free Learning Java course

TikTok for programming tips on the go

Also check out...

Support me on Patreon!

Check out my Python Basics course on Highbrow!

Free HACKATHON MODE playlist:

MY FAVORITE THINGS:
Uber Invite Code: kathrynh1277ue
Postmates Invite Code: 7373F

Want to BINGE?? Check out these playlists...

What to learn how to code during quarantine? Sign up for LinkedIn Learning!

Courses on LinkedIn Learning!

Free Learning Java course

TikTok for programming tips on the go

Also check out...

Support me on Patreon!

Check out my Python Basics course on Highbrow!

Free HACKATHON MODE playlist:

MY FAVORITE THINGS:
Uber Invite Code: kathrynh1277ue
Postmates Invite Code: 7373F

Want to BINGE?? Check out these playlists...

Рекомендации по теме
Комментарии
Автор

You're expertise not only in technical part, but also way of teaching! Thanks namastey 🙏

kalyan
Автор

this is like the best explanation of all the ways and reasons to make something immutable. I wish more explanations were this well thought out and concise!

tompov
Автор

Simple but awesome ! Everyday I find something that helps me here. Thanks for the videos

pedrosechinato
Автор

Precise and clear, can you make a video on how java is pass by value (example how Objects and arrays are pass hy value)

azeemrahman
Автор

Thank you so much for creating awesome learning videos🙏. I learned a lot from your 30 days of code playlist😃

nuhazainab
Автор

Important concept gets asked in interviews

desigeekchishi
Автор

Great explanation.. I have also read that the class should be final if we want it to be immutable? Can you also explain if that's true..

kirankumar
Автор

This is a really good point. Thank you very much madam.😍😍🔥

supun_sandaruwan
Автор

I'm new here
I love you Programing

ammarif
Автор

Let's not forget that we can still change the values of the private final fields via reflection. So, if you want to have proper guarantees of immutability, you should configure the SecurityManager or use JPMS

voidaspect
Автор

That intellij dark theme tho, shweeet

patrickordos
Автор

1st Comment ❤
Thanks for the videos! They are very time efficient and helped me alot in my interviews.

muditmathur
Автор

Hey i need a explanation on internal working of hashmap 😅

shivansh_saxena
Автор

Nicely put🤙 you should really consider going onto Udemy

kyle
Автор

String s = "hello";
s = "world";
System.out.println(s); //prints world
Why did this happen though String is immutable?

baibhabdebnath
Автор

If I had a hawt programmar gf like this, I would start writing code in Assembly.

cvxzlugynskii
Автор

Is that an accent? Why are you saying shtring instead of string with s not sh?
Iam new to english please teach me

Ilyas_Alrai
visit shbcf.ru