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

Java Chapter 11 Inheritance and Polymorphism Questions and Answers 100% Pass

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

Java Chapter 11 Inheritance and Polymorphism Questions and Answers 100% Pass Which of the following is true about method overriding? A) It allows a subclass to provide a specific implementation of a method already defined in the parent class B) It allows multiple methods with the same name but different parameters C) It is used to define private methods in subclasses D) It must be done using a different method name What happens if a subclass has a method with the same name as a method in the parent class but a different return type? A) It results in a compilation error if the return types are not covariant B) It will always override the parent method C) It creates a duplicate method in the subclass D) It forces the parent method to be deleted Which keyword is used to prevent a method from being overridden? 2 A) static B) final C) override D) protected What is polymorphism in Java? A) The ability of a method to take different forms depending on the object calling it B) The ability to define multiple classes in a single file C) A mechanism to hide variables from other classes D) The process of inheriting multiple classes Which of the following statements about method overloading is true? A) Overloaded methods must have the same return type B) Overloaded methods must have different parameter lists C) Overloading means redefining a method in a subclass D) Overloaded methods must be declared as final Which method is inherited but cannot be overridden? 3 A) final methods B) static methods C) private methods D) abstract methods Which of the following is an example of method overriding? A) A subclass redefines a method from its superclass with the same signature B) A method with the same name but different parameters in the same class C) A method with the same name but different return types in two classes D) A private method defined in a parent class and redefined in a subclass Which of the following statements is true about constructors in inheritance? A) A subclass constructor can call a superclass constructor using super() B) A subclass must always define a constructor C) A constructor can be inherited like a method D) A subclass can override a constructor What happens when a subclass object is created?

Show more Read less
Institution
Java Chapter 11 Inheritance And Polymorphism
Course
Java Chapter 11 Inheritance and Polymorphism











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

Written for

Institution
Java Chapter 11 Inheritance and Polymorphism
Course
Java Chapter 11 Inheritance and Polymorphism

Document information

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

Subjects

Content preview

Java Chapter 11 Inheritance and
Polymorphism Questions and Answers
100% Pass
Which of the following is true about method overriding?


✔✔A) It allows a subclass to provide a specific implementation of a method already defined in

the parent class

B) It allows multiple methods with the same name but different parameters

C) It is used to define private methods in subclasses

D) It must be done using a different method name




What happens if a subclass has a method with the same name as a method in the parent class but

a different return type?


✔✔A) It results in a compilation error if the return types are not covariant


B) It will always override the parent method

C) It creates a duplicate method in the subclass

D) It forces the parent method to be deleted




Which keyword is used to prevent a method from being overridden?



1

,A) static


✔✔B) final


C) override

D) protected




What is polymorphism in Java?


✔✔A) The ability of a method to take different forms depending on the object calling it


B) The ability to define multiple classes in a single file

C) A mechanism to hide variables from other classes

D) The process of inheriting multiple classes




Which of the following statements about method overloading is true?

A) Overloaded methods must have the same return type


✔✔B) Overloaded methods must have different parameter lists


C) Overloading means redefining a method in a subclass

D) Overloaded methods must be declared as final




Which method is inherited but cannot be overridden?


2

,✔✔A) final methods


B) static methods

C) private methods

D) abstract methods




Which of the following is an example of method overriding?


✔✔A) A subclass redefines a method from its superclass with the same signature


B) A method with the same name but different parameters in the same class

C) A method with the same name but different return types in two classes

D) A private method defined in a parent class and redefined in a subclass




Which of the following statements is true about constructors in inheritance?


✔✔A) A subclass constructor can call a superclass constructor using super()


B) A subclass must always define a constructor

C) A constructor can be inherited like a method

D) A subclass can override a constructor




What happens when a subclass object is created?


3

, A) Only the subclass constructor is called

B) Only the parent class constructor is called


✔✔C) The parent class constructor is called before the subclass constructor


D) The constructors are not called automatically




Which statement is true about abstract classes?


✔✔A) They can have both abstract and concrete methods


B) They must have at least one abstract method

C) They can be instantiated directly

D) They cannot have constructors




Which keyword is used to define an interface?

A) class

B) abstract


✔✔C) interface


D) extends




Which of the following statements is true about interfaces?


4

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
1 day 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

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