Java String: Working with Strings in Java Eclipse

Опубликовано: 06 Ноябрь 2019
на канале: Easy Learning
802
12

Strings are very easy to use in Java. The main thing to watch out for is that appending to strings using the + operator isn't very efficient; it creates new string objects unnecessarily. For most programs this doesn't really matter; but if you're doing lots of string handling and speed is a concern, use StringBuffer (thread-safe) or StringBuilder (not thread-safe but slightly more efficient).

Also, be aware that Java isn't the world's most efficient language for dealing with lots of text data. Perl or Python scripts will generally run much faster than a Java text-processing program.

And finally, don't forget to use .equals() to compare text in strings, not == (which compares objects, not text).


Смотрите видео Java String: Working with Strings in Java Eclipse онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Easy Learning 06 Ноябрь 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 802 раз и оно понравилось 12 людям.