The String class in Java What is a string? Let's start with a few examples of strings: "Apple", "Java", "Orange", "Dream", etc. In Java as in most other programming languages, strings are represented as a text enclosed with a pair of double quotes in syntax (Well, Python uses single quotes and double quotes, but Java only used double quotes.) Meaning of a string is whatever meaning that you as a programmer give to the string. For example, I might use "Apple" in my program to mean the fruit we eat or the computer company named Apple. Perhaps, I might use "apple" to mean fruit and "Apple" to mean the computer company. How a string is represented in memory is up to the language we happen to be using. In Java a string is represented as an array of characters. For example, the string "Dream" is represented as an array looking like this: +---+---+---+---+---+ |'D'|'r'|'e'|'a'|'m'| +---+---+---+---+---+ 0 1 2 3 4 java.lang.String is a class already defined in the language. It is NOT a primitive data type. It is instead a compound data type, a sequence of characters represented (implemented) as an array. We combine primitive data type values to form compound data type values. So, by combining characters as a sequence, we form a string. We will form a data type named, say Student, later by combining multiple primitive data types and even other compound data types, e.g., an int representing student ID, a double representing GPA, a string representing student name, and yet another string representing student's address. We will see how to do this when we create our own classes later. For now, let's study strings in a little more detail. . see StringTest.java . 'split' function on java.lang.String - see SplitTest.java When you are given a long string, you can split it into meaningful chunks and process the chunks as you see fit. SplitTest.java shows an example of one such usage. You will find this example quite useful as you deal with strings, or a long text file later.