AP Computer Science & Technology Flashcards
6 cards from real AP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 AP Computer Science & Technology flashcards as text
In AP Computer Science, what is the purpose of a constructor in object-oriented programming?
Answer: To initialize a new object's state
A constructor is a special method called when an object is created, used to initialize its attributes.
Which sorting algorithm repeatedly swaps adjacent elements that are in the wrong order?
Answer: Bubble Sort
Bubble sort compares and swaps adjacent elements repeatedly, causing larger values to 'bubble' to the end.
What does the term 'inheritance' mean in object-oriented programming?
Answer: A class receives properties and methods from a parent class
Inheritance allows a subclass to acquire the attributes and methods of a superclass, promoting code reuse.
In a binary number system, what is the decimal equivalent of 1010?
Answer: 10
Binary 1010 equals 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal.
What is the primary purpose of an array in programming?
Answer: To store multiple values of the same type under one name
An array stores a collection of elements of the same data type, accessible via index positions.
Which of the following best describes the internet protocol IP?
Answer: A set of rules for routing data packets across networks
IP is a protocol that defines how data packets are addressed and routed between devices on a network.