Java String: Working with Strings in Java Eclipse

Published: 06 November 2019
on channel: 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).


Watch video Java String: Working with Strings in Java Eclipse online without registration, duration hours minute second in high quality. This video was added by user Easy Learning 06 November 2019, don't forget to share it with your friends and acquaintances, it has been viewed on our site 802 once and liked it 12 people.