Java has primitive types: int, double, boolean, and so on. String is not one of them. A String is an object, which means it has methods you can call on it.
When you write int x = 5;, the variable x holds the value directly. When you write String s = "Hello";, the variable s holds a reference. That reference points to a String object somewhere in memory.
This distinction matters when you compare values. With primitives, == checks if two values are identical. With objects, == checks if two references point to the same object, not whether the text inside is the same. If you want to compare the actual text of two strings, you need the .equals() method. You'll see this in detail later in the section.