Java Interview shorts 1 - String Vs StringBuilder Equality Comparison #javainterview #coding

preview_player
Показать описание
Java Interview shorts 1. In this video we will learn, how the equals method of String class is different then the StringBuilder class.
In String Vs StringBuilder Equality Comparison, we always need to remember that, the equals method in StringBuilder is not overridden. So by defaults it compares the address not the contents.

For contents check we can first convert the StringBuilder objects to String using the toString() and then can use the String class equals method.

For more free/paid courses visit

#JavaInterview #SpringBootInterviewQuestions #MicroservicesInterviewQuestions

For More free/paid courses visit

LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers

Watch my new Hello spring boot series

Watch Spring boot Hot topics

Java Interview / Question and Answer series

Explain spring Bean Lifecycle

spring core

spring mvc

spring mvc intermediate

Spring JDBC

spring live project

SPRING SECURITY COURSE[NEW]

For more courses visit

Any time you are getting stuck with issues, Feel free to ask for support.

you can ping me on my Facebook page

Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"

you can ask for support in my website forum

Subscribe to my youtube channel

Follow me on Insta

#javainterview #coding #microservicesinterviewquestions #java #javastring
Рекомендации по теме
Комментарии
Автор

i am really big fan of u, depth knowledge

arjunvetal
Автор

it is very helpful.Please create more shorts vedio.

bhawnamahour
Автор

Maybe with a for loop just check every char in the string idk i don't even know what is a string builder

raffazaver
Автор

Because String has pool of string, and if text equals object string has one adreess

Qnoize
Автор

Mac os how to install programming tool please let me help me

chinnababu
Автор

I didn't hear well. Because inside StringBuilder class equals() isn't overrided? If yes, why?

Gorky
Автор

So, should we use ' = ' to compare the string builder ?

shubhamjaiswal
Автор

but .equals() method always compares values and not locations right?

brindapatel
Автор

Why are you using new String("hi"); when you can just do "hi";

Manere
Автор

String s1 = "cricket";
String s2 = "cricket";
????

karthickjayaraman
Автор

This ruins the entire purpose of using the equals method and not == operator 🤣

HR-pzts