What this deck covers
This deck focuses on Abstraction And Program Design, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study Abstraction And Program Design in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
Identify the keyword to declare a class as abstract.
Tap card or press Space to flip
The 'abstract' keyword is used to declare an abstract class. Marks class as incomplete, requiring subclass implementation.
How well did you know it?
Card 1 / 62
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Abstraction And Program Design, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: The 'abstract' keyword is used to declare an abstract class. Marks class as incomplete, requiring subclass implementation.
Answer: The 'implements' keyword is used to implement an interface. Creates contractual obligation to provide method implementations.
Answer: A concrete class is a class that has no abstract methods. Can be instantiated directly, no abstract methods present.
Answer: 'public' makes a class, method, or field accessible from any other class. Broadest access level, no restrictions on usage.
Answer: The result is 3.5, due to floating-point division. Double operand promotes calculation to floating-point arithmetic.
Answer: The 'abstract' keyword is used to declare an abstract class. Marks class as incomplete, requiring subclass implementation.
Answer: Abstraction reduces complexity and increases efficiency. Simplifies development by hiding unnecessary implementation details.
Answer: Methods must have a body unless declared abstract. Non-abstract methods require implementation in concrete classes.
Answer: 'private' restricts access to the class itself. Most restrictive access, only within declaring class.
Answer: Abstraction reduces complexity and increases efficiency. Simplifies development by hiding unnecessary implementation details.
Answer: An abstract class cannot be instantiated and may contain abstract methods. Serves as template, requires subclasses for instantiation.
Answer: 'protected' allows access within the same package and subclasses. Package access plus inheritance-based access for subclasses.
Answer: A static method belongs to the class rather than any object instance. Called on class itself, not requiring object instantiation.
Answer: 'protected' allows access within the same package and subclasses. Package access plus inheritance-based access for subclasses.
Answer: Java does not support multiple inheritance of classes. Classes can only extend one superclass in Java.
Answer: Abstraction is hiding complex details to simplify problem solving. Core concept of managing complexity by focusing on essential features.
Answer: The result is 3, due to integer division. Both operands are integers, so result truncates decimal portion.
Answer: The 'extends' keyword is used to inherit a class. Establishes is-a relationship between parent and child classes.
Answer: public static void main(String[] args). Entry point for Java applications, must match exact format.
Answer: No error; the syntax is correct. Static variables are properly declared at class level.
Answer: A superclass is the class from which a subclass inherits. Also called parent class, provides structure for child classes.
Answer: Java does not support multiple inheritance of classes. Classes can only extend one superclass in Java.
Answer: Polymorphism allows for methods to do different things based on the object it is acting upon. Enables same method name to behave differently across classes.
Answer: Duplicate parameter name 'a'. Parameter names must be unique within method signature.
Answer: A subclass is a class that inherits from another class, the superclass. Also called child class, extends functionality of parent class.
Answer: Abstraction is hiding complex details to simplify problem solving. Core concept of managing complexity by focusing on essential features.
Answer: The default access modifier is package-private. Accessible within package but not from outside packages.
Answer: A constructor is a special method to initialize objects. Called automatically when creating new object instances.
Answer: Method overriding is an example of polymorphism. Subclass methods can replace superclass method behavior.
Answer: Interfaces cannot have method bodies. Only default and static methods can have implementations.
Answer: Polymorphism allows for methods to do different things based on the object it is acting upon. Enables same method name to behave differently across classes.
Answer: A concrete class is a class that has no abstract methods. Can be instantiated directly, no abstract methods present.
Answer: The 'extends' keyword is used to inherit a class. Establishes is-a relationship between parent and child classes.
Answer: No error; this is a valid constructor. Private constructors are legal, often used in singleton patterns.
Answer: Encapsulation protects an object's internal state from unintended modification. Private fields prevent direct external manipulation of data.
Answer: Use 'int x;' or 'Integer x = new Integer();'. Primitives cannot use constructor syntax, only reference types.
Answer: Abstraction can be achieved using abstract classes and interfaces. Both provide contracts without revealing implementation details.
Answer: Interfaces cannot have method bodies. Only default and static methods can have implementations.
Answer: public static void main(String[] args). Entry point for Java applications, must match exact format.
Answer: 'final' is used to declare constants, prevent inheritance, and prevent method overriding. Prevents modification, inheritance, or method overriding.
Answer: 'public' makes a class, method, or field accessible from any other class. Broadest access level, no restrictions on usage.
Answer: 'this' is used to refer to the current object instance. Distinguishes between instance variables and parameters with same names.
Answer: 'this' is used to refer to the current object instance. Distinguishes between instance variables and parameters with same names.
Answer: Inheritance promotes code reuse. Avoids duplicating code across multiple related classes.
Answer: No error; the syntax is correct. Static variables are properly declared at class level.
Answer: Use 'int x;' or 'Integer x = new Integer();'. Primitives cannot use constructor syntax, only reference types.
Answer: A subclass is a class that inherits from another class, the superclass. Also called child class, extends functionality of parent class.
Answer: Inheritance allows a class to inherit fields and methods from another class. Enables code reuse by establishing parent-child class relationships.
Answer: The result is 3.5, due to floating-point division. Double operand promotes calculation to floating-point arithmetic.
Answer: Method overriding is redefining a superclass method in a subclass with the same signature. Allows subclasses to provide specific implementations.
Answer: Method overriding is an example of polymorphism. Subclass methods can replace superclass method behavior.
Answer: Encapsulation is bundling data with methods that operate on it. Key principle protecting data integrity through controlled access.
Answer: Abstraction can be achieved using abstract classes and interfaces. Both provide contracts without revealing implementation details.
Answer: Method overloading is having multiple methods with the same name but different parameters. Provides flexible method calls with different parameter sets.
Answer: A package is a namespace for organizing classes and interfaces. Groups related classes to prevent naming conflicts.
Answer: Encapsulation is bundling data with methods that operate on it. Key principle protecting data integrity through controlled access.
Answer: A superclass is the class from which a subclass inherits. Also called parent class, provides structure for child classes.
Answer: Encapsulation protects an object's internal state from unintended modification. Private fields prevent direct external manipulation of data.
Answer: A constructor is a special method to initialize objects. Called automatically when creating new object instances.
Answer: Duplicate parameter name 'a'. Parameter names must be unique within method signature.
Answer: 'private' restricts access to the class itself. Most restrictive access, only within declaring class.
Answer: Inheritance allows a class to inherit fields and methods from another class. Enables code reuse by establishing parent-child class relationships.