Tino APCS

Strings

Lesson Overview: Strings are needed in many programming tasks. Much of the information that identifies a person must be stored as a string: name, address, city, social security number, etc. This lesson covers the specifications of the String class and how to use it to solve string-processing problems.

Lesson Vocab
charAt

The String method that returns a char in the String at a specified index.

compareTo

A String method that compares a specified String to the current String.

CONCATENATION

Adding two Strings together using the + operator.

equals

A String method that compares the content of two Strings to see if they are equivalent.

GARBAGE

An object with no references to it.

GARBAGE COLLECTION

A Java process that removes inaccessible objects from memory.

IMMUTABLE

An object that cannot be changed.

length

A String method that returns the length in characters of the String.

nextLine

A Scanner method that returns a String ending when the Scanner object reaches a newline character.

next

A Scanner method that returns a String ending when the Scanner object reaches whitespace.

String Class

A class that holds a group of characters.

null

Defines that an identifier points to no value.

substring

A String method that returns a designated portion of a String.

STRING LITERAL

Hard-coded characters enclosed within double quotation marks, representing a String.

toString

A method that returns the String equivalent of any object.

toLowerCase

A String method that returns the String without any capital letters.

toUpperCase

A String method that returns the String without any lower case letters.

alias

When two reference variables reference the same object, they are called aliases.