AP® Computer Science A glossary
length()
Also called: length
Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods
The String method that returns the number of characters in a String.
Appears in the course and exam description (CED): 1.15.B.2
Each escape sequence counts as one character. The empty string "" has length 0.
System.out.println("INTERFACE".length());
System.out.println("".length());
Output:
9
0 Learn it properly, with a checkpoint 1.15 String Manipulation