Evaluate Java code snippet with inheritance
Filed under GoDigit
The question
Analyze a given Java code snippet involving classes A and B where B extends A, and a Test class trying to initialize a parent class object with a child reference, and explain why it causes an error.
No write-up yet. Related questions below have one.
Related GoDigit questions
Collected from public candidate posts and coding forums. Updated Nov 2026.