Java OOP and Inheritance Flashcards
6 cards from real SCJP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Java OOP and Inheritance flashcards as text
Which of the following correctly describes method overloading in Java?
Answer: Same method name, different parameter list in the same class
Method overloading requires the same method name but a different parameter list (number, type, or order) within the same class.
What is the IS-A relationship in Java OOP?
Answer: Inheritance
The IS-A relationship is established through inheritance — a subclass IS-A type of its superclass.
Which of the following is NOT a valid way to achieve polymorphism in Java?
Answer: Method overloading at runtime
Method overloading is resolved at compile time (static binding), so it does not contribute to runtime polymorphism.
If class B extends class A and both define `toString()`, which `toString()` is called when `A obj = new B(); System.out.println(obj);`?
Answer: B's toString()
Because `toString()` is overridden in B and Java uses dynamic dispatch, B's `toString()` is invoked at runtime.
Which Java feature allows a class to inherit behavior from multiple sources without multiple inheritance of classes?
Answer: Interfaces with default methods
Since Java 8, interfaces can have `default` methods, allowing a class to inherit behavior from multiple interfaces.
What is the purpose of the `super` keyword when used inside a method body?
Answer: To access superclass methods or fields hidden by the subclass
`super` in a method body refers to the superclass, allowing access to its overridden methods or hidden fields.
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy