AP® Computer Science A glossary

Integer (class)

Also called: Integer

Course: AP® Computer Science A Shows up in: Unit 4: Data Collections

The java.lang wrapper class whose immutable objects hold one int value; Integer.parseInt(s) returns a String as an int.

Appears in the course and exam description (CED): 4.7.A.14.7.A.24.7.A.34.7.A.4

Use Integer as the type parameter for a list of whole numbers. An Integer variable can be null, and unboxing null throws a NullPointerException.

Integer count = Integer.parseInt("41");
count++;
System.out.println(count);

Output:

42
Learn it properly, with a checkpoint 4.7 Wrapper Classes

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