Guided Notes

Strings & Math

String methods, concatenation, special characters, StringBuilder, and the Math class.

Strings

Slide 1 / 5

A String holds text in double quotes: String name = "Ada Lovelace";

Strings are objects with methods: name.length() β†’ 12 name.toUpperCase() β†’ "ADA LOVELACE" name.indexOf("Love") β†’ 4 name.charAt(0) β†’ 'A' name.substring(4) β†’ "Lovelace" name.contains("Ada") β†’ true

Strings are immutable β€” methods return a new String and never change the original.

← Variables, Types & Operators