Full Java Course:
I recommend installing Tabnine autocomplete on your IDE (free):
You can compare strings in Java with either == or equals(). This video goes over when to use each. Most of the time you’ll want to use equals to compare strings in Java because it compares the contents, not the object itself.
I hope you enjoyed this Java string comparison tutorial!
Free tips and programs:
Recommended Channels to Subscribe to
Tag: equals java, java string, java strings, java string comparison, java string compare, string methods in java, java equals method, java equals vs ==, string equals vs == java, java strings tutorial, alex lee java strings, alex lee, java, compare strings, compare string in java, string equals java
Xem thêm: https://blogthủthuật.vn/category/review
Can you do a tutorial on hashcode method? They say it almost always go with the equals method.
How to do with scannee calss
When you realize youtubers explain way more better than University proffessor
I wonder why you are not using IntelliJ?
Can you make a video on using rhe equals method and hashcode
Thanks for the great videos 📹
Bro, you got wrong here as Constructor is used to initialise the object "new" keyword is used to make object!
Alex, you're awesome! Thank you sm for teaching me how to use Java.
You should explain about memory allocation for this for better understanding. Like heap and string pool.
couldn't you use boolean somehow instead of typing an output for true and false?
5:40 : u can use [String].equalsIgnoreCase([String]); 🙂
Dude excellent explanation!
thanks for this informative Tutorial
Alex you are a good tutor, keep uploading new videos,don't worry i am daily at your videos,make easy videos and tutorials for evrything of java and i mean everything
i have a question but it is not reffering to java – Which video screen capture are you using ? and how do you do that thing that i see your screen and a little screen of you on buttom ?
Very helpful. Thank you.
Thank you so much Alex! I've been binge watching all your tutorials, you've helped me more than my own teacher at university xp
That bonus tip is very helpful, thank you dude!
Thanks a lot! This was exactly what I needed when I needed it.
Hey! How can I search for a part of a string in an array or text file?
So just putting in "ong" should recognize the whole Object "Happy Song".
Thanks prior for the answer!
What is the outro song??? Please tell me someone.
I think that what makes your videos better than most comp sci courses is that cs professors assume you have a perfect grasp on everything learned up to that topic while you assume that I don't know anything about anything…
pulled up to learn about strings, left understanding classes
you are amazing
im praying you hit the dark mode button
I don't understand why there are even DISLIKES on Alex's videos. Who could hate this man?
The screen becomes clear.
I wonder what the devs were smoking when they designed strings in java
(-ㅂ-)/ ♥ ♥ ♥
The == operator checks if both variables points to the same memory location. So when you compared String a = "lemur" to String b = "lemur" the operator == returns true because, since both variable a and b are allocated a similar String value. The compiler will store a single copy of that value. Meaning that both variable a and b will point to the same address/memory location. This feature is called "interning". When you declared String a = new String("lemur") and String b = new String("lemur"). The compiler creates two objects that are stored in separate memory locations. So of course the == will return false. What the equals() method does is. It compares the value stored by two objects irrelevant of their memory location. Hope this makes it easier to remember the difference between the two.
Thank You Bro <3 :