Why you should NOT concatenate the Strings using the "+" operator [Java]

Why you should NOT concatenate the Strings using the "+" operator [Java]

if else statement

3 года назад

1,345 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Turruc
Turruc - 18.01.2023 07:06

Thank you so much for this. I was doing the Reverse Integer problem on Leetcode and decided to try to do it using string manipulation, and I was surprised how slow it was compared to other methods. If you don't mind me asking, why were strings designed this way? Are there any cases where Strings would be better than StringBuilders other than just convenience?

It seems to me that Strings should just act this way under the hood to be faster, but I assume I'm just not seeing the big picture. There has to be some reason Strings need to be immutable, right?

Ответить
Kaustav Borgohain
Kaustav Borgohain - 25.08.2022 10:05

You deserve more views

Ответить
Polina Chefranova
Polina Chefranova - 21.02.2021 21:50

Very nice video! Thank you!

Ответить