
Transitioning to Java
By :

A string, with a lowercase s, is a list of characters that usually represent a word we may write or speak. String
, with a capital S, is a class that contains a list of zero or more characters and numerous operations that you can perform on them. As a class, it normally must be instantiated into an object. As developers commonly use String
objects, Java can perform the instantiation implicitly whenever you use the assignment operator (=
) with a String
variable. When referring to this data type, we always capitalize the first letter. This way, we know that we are referring to the String
class. We will cover classes and objects in more depth in the coming chapter.
Let us examine String
and how we use it. We begin with the specification table:
Table 4.6 – Specs for String and how we can use it
In this table, Size in bytes refers to two parts of String
. The first, called a reference, is a variable that contains the address...