- Strings are an incredibly common type of data in computers. This page introduces the basics of Java strings: chars, +, length(), and substring().
- A Java string is a series of characters gathered together, like the word "Hello", or the phrase "practice makes perfect". Create a string in the code by writing its chars out between double quotes.
String str = "Hello";
This picture shows the string object in memory, made up of the individual chars H e l l o. We'll see what the index numbers 0, 1, 2 .. mean later on.
No comments:
Post a Comment