Java Interview Shorts 2 - How to compare two String Builder object's Equality ? || Java 11 updates

preview_player
Показать описание
in this video we will understand how to compare two StringBuilder class objects. As inside the StringBuilder class the equals method hasn’t been overridden, it compares the address by default and returns false when comparing two equal string builder class objects.

So to fix this, we can first convert the stringbuilder objects to String using toSring() and then do an equal comparison else we can use the Java 11 update. From the java 11 Java’s String Builder class implements the Comparable interface and overrides the compareTo() . When two String builder objects are equal, it return 0.

For more free/paid courses visit

#JavaInterview #javainterviewquestions #corejava #coding #programing

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
Рекомендации по теме
Комментарии
Автор

You should did this years ago! it will be amazing for the channel. Thanks for sharing your knowledge

cesarestrada
Автор

I was started watching your videos from 2016, amazing journey bro 🎉🎉

srikanthveepuru
Автор

Best way bro don't stop that please everyday

raeedtech
Автор

Nice short videos. If possible full videos of the link share only interview questions of the 1.8 onwards. Thank you bro

kirankiransai
Автор

Love shorts please make long video on how to crack interviews

movietrailer
Автор

I don't get it instead of implementing a new compareto method why don't they just implement equals if it is that much needed feature.

nikunjmmistry