Loading…
Loading…
Ten exam-style questions on object versus reference type, implicit and explicit casts, ClassCastException, casts the compiler rejects, instanceof, virtual method calls, and hidden fields and static methods, with explanations.
Practice questions for the article Java Polymorphism: Reference Types, Casting and Virtual Method Calls.
For each line, ask two questions: what type is the reference (that decides what compiles), and what type is the object (that decides which override runs)? Aim for at least 8 out of 10.
Quiz path: step 51. Take the quizzes in this order, after reading each article.
Previous quiz: Local and Anonymous Classes (OCP 21)
Next quiz: Chapter 7 Review: Beyond Classes (OCP 21)
10 questions · pass at 68%
Check your understanding; you see the answers and explanations after submitting.
Discussion
Sign in to ask a question or share what you learned.