100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Java II Chapter 11: Advanced Inheritance Concepts Questions and Answers Already Passed

Rating
-
Sold
-
Pages
27
Grade
A
Uploaded on
15-03-2025
Written in
2024/2025

Java II Chapter 11: Advanced Inheritance Concepts Questions and Answers Already Passed When an interface method is implemented in a class, what access modifier must it have? A) private B) protected C) public D) final Which of the following is NOT a feature of polymorphism in Java? A) Method overloading B) Method overriding C) Multiple class inheritance D) Dynamic method dispatch What happens if a subclass constructor does not explicitly call a superclass constructor? A) The default constructor of the superclass is automatically called B) A compilation error occurs 2 C) The subclass cannot be instantiated D) The program crashes at runtime Can a subclass access private fields of a superclass? A) Yes, directly B) No, only through getter methods or protected fields C) Yes, but only if the subclass is in the same package D) Yes, by using the super keyword What happens if a method in a subclass has the same name as a method in its superclass but a different return type? A) A compilation error occurs unless it is a covariant return type B) The subclass method overrides the superclass method C) The superclass method is hidden but still accessible D) Java automatically converts the return type Which of the following correctly describes the protected access modifier? A) It allows access within the same package and subclasses 3

Show more Read less
Institution
Java II Chapter 11: Advanced Inheritance Concepts
Course
Java II Chapter 11: Advanced Inheritance Concepts










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Java II Chapter 11: Advanced Inheritance Concepts
Course
Java II Chapter 11: Advanced Inheritance Concepts

Document information

Uploaded on
March 15, 2025
Number of pages
27
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

Java II Chapter 11: Advanced Inheritance
Concepts Questions and Answers
Already Passed
When an interface method is implemented in a class, what access modifier must it have?

A) private

B) protected


✔✔C) public


D) final




Which of the following is NOT a feature of polymorphism in Java?

A) Method overloading

B) Method overriding


✔✔C) Multiple class inheritance


D) Dynamic method dispatch




What happens if a subclass constructor does not explicitly call a superclass constructor?


✔✔A) The default constructor of the superclass is automatically called


B) A compilation error occurs

1

,C) The subclass cannot be instantiated

D) The program crashes at runtime




Can a subclass access private fields of a superclass?

A) Yes, directly


✔✔B) No, only through getter methods or protected fields


C) Yes, but only if the subclass is in the same package

D) Yes, by using the super keyword




What happens if a method in a subclass has the same name as a method in its superclass but a

different return type?


✔✔A) A compilation error occurs unless it is a covariant return type


B) The subclass method overrides the superclass method

C) The superclass method is hidden but still accessible

D) Java automatically converts the return type




Which of the following correctly describes the protected access modifier?


✔✔A) It allows access within the same package and subclasses



2

, B) It allows access only within the same class

C) It allows access only within the same package

D) It allows access from any class in any package




Can an abstract class implement an interface?


✔✔A) Yes, but it does not have to implement all methods


B) No, only concrete classes can implement interfaces

C) Yes, but it must implement all methods

D) No, abstract classes cannot extend anything




If a superclass method is final, what happens if a subclass tries to override it?


✔✔A) A compilation error occurs


B) The method is overridden successfully

C) The method becomes abstract

D) The subclass method executes instead




What does the super keyword do in Java?

A) It refers to the current instance of a class


3

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BrilliantScores Chamberlain College Of Nursng
View profile
Follow You need to be logged in order to follow users or courses
Sold
2813
Member since
3 year
Number of followers
2232
Documents
16100
Last sold
2 days ago
latest updated documents, correct, verified & graded A study materials

get bundles, documents, test banks, case studies, shadow health's, ATIs, HESIs, study guides, summary, assignments & every kind of study materials.

3.8

772 reviews

5
388
4
116
3
116
2
37
1
115

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions