String functionality
Working with strings in Java can be a little confusing at first because they really are a special case. Strings have associated with them this concept of a string literal, that is, a sequence of characters between double quotation marks. We can just put it right into our Java programs and Java will understand it, just like it would understand an integer number or a single character.
Unlike integers, characters, and floats, Java doesn't have a primitive keyword associated with this string literal. About the closest we could get if we wanted to is a character array; however, generally, Java likes us to associate string literals with the String class. To understand the String class better, look at the following program: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access