AP® Computer Science A glossary

String literal

Course: AP® Computer Science A Shows up in: Unit 1: Using Objects and Methods

A sequence of characters enclosed in double quotes, such as "Game over".

Appears in the course and exam description (CED): 1.3.B.21.15.A.1

A string literal is text in double quotes. Java prints it exactly as written, without calculating anything inside. It is one way to create a String object.

System.out.println("7 + 3");
System.out.println(7 + 3);

Output:

7 + 3
10
Learn it properly, with a checkpoint 1.3 Expressions and Output

Related terms

Was this page helpful?

No names are ever shown, and every public comment is checked by us first. Please do not include personal details. To get a reply, email [email protected].

↑ Top

Enlarged view of the selected figure