What this deck covers
This deck focuses on Class Variables And Methods, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study Class Variables And Methods 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 main disadvantage of using class variables extensively?
Tap card or press Space to flip
Increased coupling. Global state creates dependencies between classes.
How well did you know it?
Card 1 / 69
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Class Variables And Methods, 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: Increased coupling. Global state creates dependencies between classes.
Answer: No. Abstract requires inheritance; static methods cannot be overridden.
Answer: Access static members without class name. Allows direct access to static members without qualification.
Answer: Yes. Final prevents method from being overridden.
Answer: Yes. Multiple methods with same name but different parameters.
Answer: synchronized. Synchronized ensures thread-safe access to the method.
Answer: false. Boolean primitive type defaults to false.
Answer: final. Final prevents reassignment after initialization.
Answer: Final variables cannot be reassigned. Final variables are constants after initialization.
Answer: No. Static context cannot access non-static members directly.
Answer: synchronized. Synchronized ensures thread-safe access to the method.
Answer: Yes. Final prevents method from being overridden.
Answer: Compilation error. Static context cannot access non-static members.
Answer: Yes. Static methods can call other static members directly.
Answer: Method Area. Static variables are stored in the method area of memory.
Answer: Final variables cannot be reassigned. Final variables are constants after initialization.
Answer: Initialize static variables. Static blocks run once when class is first loaded.
Answer: Static methods cannot override instance methods. Static methods cannot participate in polymorphism.
Answer: Does not require an instance of the outer class. Static nested classes don't need outer class instances.
Answer: final. Final prevents method from being overridden in subclasses.
Answer: Static methods cannot access instance variables directly. Static methods need object reference for instance variables.
Answer: Shared data among all instances. One copy exists for all objects of the class.
Answer: Yes, but not recommended. Compiler allows but style guides discourage this practice.
Answer: 0.0. Floating-point primitive types default to 0.0.
Answer: Valid but discouraged. Works but using class name is clearer style.
Answer: Yes. Static methods can call other static members directly.
Answer: No. Static methods belong to class, cannot be overridden.
Answer: static. Makes the method belong to the class, not instances.
Answer:
Answer: final. Final prevents reassignment after initialization.
Answer: MathUtils.compute(). Use ClassName.methodName() syntax for static methods.
Answer: Static methods cannot access instance variables directly. Static methods need object reference for instance variables.
Answer: No. Abstract requires inheritance; static methods cannot be overridden.
Answer: A variable declared with the static keyword, shared by all instances. Belongs to the class itself, not individual objects.
Answer: Static methods cannot override instance methods. Static methods cannot participate in polymorphism.
Answer: Shared data among all instances. One copy exists for all objects of the class.
Answer: Initialize static variables. Static blocks run once when class is first loaded.
Answer: Entire class. Class variables exist at the class level globally.
Answer: Static variables first, then static blocks. Static initialization follows declaration order in source code.
Answer: Does not require an instance of the outer class. Static nested classes don't need outer class instances.
Answer: default. Default means package-private visibility.
Answer: A method declared with the static keyword, can be called without an instance. Belongs to the class, accessible without creating objects.
Answer: Entire class. Class variables exist at the class level globally.
Answer: MathUtils.compute(). Use ClassName.methodName() syntax for static methods.
Answer: static. Makes the variable belong to the class, not instances.
Answer: Belongs to the class, not instances. Static members are associated with the class itself.
Answer: Default value is assigned. Java automatically assigns default values to static variables.
Answer: Yes. Static methods can access other static members.
Answer: public. Public modifier allows access from any class.
Answer: Yes, but not recommended. Compiler allows but style guides discourage this practice.
Answer: Static variables first, then static blocks. Static initialization follows declaration order in source code.
Answer:
Answer: Yes. Private restricts access to the declaring class only.
Answer: No. Static methods belong to class, cannot be overridden.
Answer: Increased coupling. Global state creates dependencies between classes.
Answer: Package-private. No access modifier means package-private visibility.
Answer: Default value is assigned. Java automatically assigns default values to static variables.
Answer: A method declared with the static keyword, can be called without an instance. Belongs to the class, accessible without creating objects.
Answer: false. Boolean primitive type defaults to false.
Answer: Package-private. No access modifier means package-private visibility.
Answer: static. Makes the variable belong to the class, not instances.
Answer: 0.0. Floating-point primitive types default to 0.0.
Answer: public. Public modifier allows access from any class.
Answer: Yes. Static methods can access other static members.
Answer: Valid but discouraged. Works but using class name is clearer style.
Answer: default. Default means package-private visibility.
Answer: Method Area. Static variables are stored in the method area of memory.
Answer: final. Final prevents method from being overridden in subclasses.
Answer: Access static members without class name. Allows direct access to static members without qualification.