Title: Key Concept - Strings
Course: CPS 189: Java Certification - Review, Practice & Prepare (Development) > Section: Learning Modules

A string is a sequence of zero or more characters. A string is an object instantiated through the String class.

A string literal is enclosed in double quotes.

The String class includes the following methods:

- length returns the number of characters stored in a string (object).
- concat links the characters in one string with another.
- format returns a sequence of expressions identical to that used in a printf statement.
- compareTo and compareToIgnoreCase compare two strings lexicographically and return an integer indicating whether one string is less than, equal to, or greater than the other string.
- equals and equalsIgnoreCase compare two strings and return true if so.
- charAt returns the character from a string at the given index.
- toLowerCase returns the lowercase version of a string.
- toUpperCase returns the uppercase version of a string.

The concatenation operator (+) links the characters in two expressions.

Each wrapper class (Byte, Integer, Double, Float, Long, and Short) has method valueOf that converts a string object to an object of those types.

Each wrapper class also has method toString that converts from an object of those types to a string object.