SummaryTopReading and writing filesStrings and Characters

Strings and Characters

In Java, char is a primitive type (a subtype of int, strangely). A char is written with single quotes, 'a', while a string is written with double quotes. Thus 'a' and "a" are of different types!. You can access individual characters in a String using charAt, and get the size with myString.length() (note that the "()" is required!).

Methods similar to those in Grace are available. Common ones include:


SummaryTopReading and writing filesStrings and Characters