Java's strings differ from the strings of C and C++, because Java's
strings are instances of the String
class, rather than arrays of
characters. In Java, the length of a string is determined by the
length
method.
In C and C++, you determine length by looking for the first null character in the array. Most programmers believe that Java's approach is simpler from the conceptual perspective, and is easier to work with from the practical perspective.