What this deck covers
This deck focuses on Scope And Access, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study Scope And Access 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
What is the scope of a public class?
Tap card or press Space to flip
Accessible from any package. Public classes can be imported and used anywhere.
How well did you know it?
Card 1 / 71
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Scope And Access, 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: Accessible from any package. Public classes can be imported and used anywhere.
Answer: Variable 'y' is not declared. Variable y was never declared before being used.
Answer:
Answer: Belongs to the class, not instances. Can be called without creating an instance of the class.
Answer: final. Makes variables immutable after initialization.
Answer: Variable 'x' might not have been initialized. Local variables must be explicitly initialized before use.
Answer: super. References the parent class in inheritance hierarchy.
Answer: Cannot access private member 'x'. Private members are not inherited by subclasses.
Answer: Class, package, and subclasses. More restrictive than public, less than private.
Answer: Missing 'String[] args' in main method. Main method requires String array parameter to be valid entry point.
Answer: final. Makes variables immutable after initialization.
Answer: Class-level scope. Instance variables are accessible throughout the entire class.
Answer: Until the method finishes. Local variables are destroyed when method execution ends.
Answer: Static variable. Static variables belong to the class, not individual objects.
Answer: Assignment outside method or constructor. Assignment statements must be inside methods or constructors.
Answer: Refers to the current object. Distinguishes instance variables from parameters with same names.
Answer: final. Prevents subclasses from overriding the method.
Answer: Variable 'x' might not have been initialized. Loop variable i is declared but not initialized.
Answer: Cannot assign to 'this'. 'this' is a reference and cannot be reassigned.
Answer: Class cannot be subclassed. Prevents the class from being extended by other classes.
Answer: Public. Only access level that crosses package boundaries freely.
Answer: Assignment outside method. Direct assignment statements must be inside methods or constructors.
Answer: Local to the block. Block variables exist only within their enclosing braces.
Answer:
Answer: Allows static members to be used without class name. Enables direct use of static members without qualification.
Answer: protected. Provides inheritance access while maintaining some encapsulation.
Answer: final. Prevents subclasses from overriding the method.
Answer: Local to the method. Parameters are local variables passed to the method.
Answer: Missing 'String[] args' in main method. Main method requires String array parameter to be valid entry point.
Answer: Cannot assign to 'this'. 'this' is a reference and cannot be reassigned.
Answer: Accessible by class name. Static methods can be called using the class name directly.
Answer: Accessible from any package. Public classes can be imported and used anywhere.
Answer: Accessible by class name. Static methods can be called using the class name directly.
Answer: Variable 'x' might not have been initialized. Loop variable i is declared but not initialized.
Answer: Assignment outside method. Direct assignment statements must be inside methods or constructors.
Answer: Public. Interface methods are implicitly public and abstract.
Answer: final. Prevents methods from being overridden in subclasses.
Answer: Variable 'y' is not declared. Variable y was never declared before being used.
Answer: Local variable scope. Variables accessible only within their declaring method or constructor.
Answer: Package-private. Default access when no explicit modifier is provided.
Answer: Local variable scope. Variables accessible only within their declaring method or constructor.
Answer: protected. Provides inheritance access while maintaining some encapsulation.
Answer: Throughout the class. Instance variables are accessible from all methods in the class.
Answer: extends. Establishes inheritance relationship between classes.
Answer: Allows static members to be used without class name. Enables direct use of static members without qualification.
Answer: Public. Only access level that crosses package boundaries freely.
Answer: Local to the block. Block variables exist only within their enclosing braces.
Answer: Void method cannot return a value. Void methods cannot use return statements with values.
Answer: Until the method finishes. Local variables are destroyed when method execution ends.
Answer: new. Allocates memory and creates object instances.
Answer: Class, package, and subclasses. More restrictive than public, less than private.
Answer: Static variable. Static variables belong to the class, not individual objects.
Answer: Package-private. Default access when no explicit modifier is provided.
Answer: Shared across all instances. One copy exists for the entire class, not per instance.
Answer: Void method cannot return a value. Void methods cannot use return statements with values.
Answer: Variable 'x' might not have been initialized. Local variables must be explicitly initialized before use.
Answer: Local to the method. Parameters are local variables passed to the method.
Answer: Assignment outside method or constructor. Assignment statements must be inside methods or constructors.
Answer: Belongs to the class, not instances. Can be called without creating an instance of the class.
Answer: new. Allocates memory and creates object instances.
Answer: final. Prevents methods from being overridden in subclasses.
Answer: Class-level scope. Instance variables are accessible throughout the entire class.
Answer: private. Most restrictive access level in Java.
Answer: Shared across all instances. One copy exists for the entire class, not per instance.
Answer: Local to the method. Method variables are only accessible within that specific method.
Answer: super. References the parent class in inheritance hierarchy.
Answer: private. Most restrictive access level in Java.
Answer: Local to the method. Method variables are only accessible within that specific method.
Answer: Public. Interface methods are implicitly public and abstract.
Answer: Cannot access private member 'x'. Private members are not inherited by subclasses.
Answer: Class cannot be subclassed. Prevents the class from being extended by other classes.