Last Updated on August 9, 2024
AP Computer Science Unit 2—Test Review Practice Questions. AP Computer Science Principles (CSP) Unit 2: Using Objects Review Practice Test 2024: College Board’s Advanced Placement® Program (AP®) Computer Science Principles (CSP) Unit 2: The exam includes reference data to represent real-world objects in a digital world and discover methods to perform more complex operations.
In Unit 2, “Using Objects,” you focus on understanding and using objects and classes to model real-world entities and perform operations. This involves working with attributes, methods, constructors, and leveraging class libraries.
AP Computer Science Unit 2 – Test Review Practice Questions
AP CSP Practice Test 2024 Study Guide [UPDATED]
- Unit 1: Primitive Types
- Unit 2: Using Objects
- Unit 6: Array,
Unit 7: ArrayList
Unit 8: 2D Array - Unit 9: Inheritance
- Unit 10: Recursion
Topics Overview
Objects and Classes
- Objects: Instances of classes that represent real-world entities.
- Classes: Blueprints for creating objects, defining attributes (fields) and behaviors (methods).
- Attributes: Variables within a class that hold the state of an object.
- Behaviors: Methods within a class that define what an object can do.
Creating Objects
- Constructors: Special methods used to initialize objects.
- Default Constructor: Initializes objects with default values.
- Parameterized Constructor: Initializes objects with specified values.
Class Libraries
- Integer and Double Classes: Wrapper classes for primitive data types.
- Math Class: Provides methods for mathematical operations.
- String Class: Manages and manipulates text data.
Methods
- Non-Static Methods: Operate on instances of a class and can access instance variables.
- Static Methods: Belong to the class itself rather than instances and can’t access instance variables.
- Void Methods: Do not return a value.
String Objects and Methods
- String Manipulation: Methods to handle text, such as
length()
,substring()
, andtoUpperCase()
.
APIs and Libraries
- Using External Libraries: Integrating and utilizing predefined code to perform tasks.
- Application Program Interfaces (APIs): Interfaces that allow interaction with other software components.