filmov
tv
Java Interview Shorts 2 - How to compare two String Builder object's Equality ? || Java 11 updates
![preview_player](https://i.ytimg.com/vi/bKL0ao1VmVU/maxresdefault.jpg)
Показать описание
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
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
Комментарии