AP CSA Unit 3 Day 20: Inheritance Access
Share
Unit 3, Classes & Objects • Cycle 2
Day 20 Advanced Practice • Harder Difficulty
Focus: Inheritance Access
Hard
Inheritance Access
Advanced Practice Question
Format: Inheritance Access
Which variables can Child access?
Which variables can Child access?
public class Parent {
private int a = 1;
public int b = 2;
protected int c = 3;
}
public class Child extends Parent {
public void test() {
// Which variables accessible here?
}
}
Difficulty: Hard |
Topic: Inheritance Access |
Cycle: 2 (Advanced)
Why This Answer?
Private (a) is never inherited/accessible. Public (b) and protected (c) are accessible in subclasses. So b and c are accessible.
Common Mistake
Watch Out!
Thinking protected means 'extra private' instead of 'accessible to subclasses'.
AP Exam Strategy
Private = not inherited. Protected = inherited. Public = inherited.
Master This Topic
This Cycle 2 HARD question tests inheritance access. Review Unit 3 concepts to build mastery of classes & objects.
- Understanding inheritance access
- Tracing code execution accurately
- Avoiding common pitfalls
Ready for More Challenges?
Cycle 2 questions prepare you for the hardest AP CSA exam questions.
Study Games Practice FRQs