Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 8 pages
Exam (elaborations)

JAVA 3252 Chapter 11 polymorphism- Questions and Answers| Latest Update

Document preview thumbnail
Preview 2 out of 8 pages

JAVA 3252 Chapter 11 polymorphism- Questions and Answers| Latest Update

Content preview

JAVA 3252 Chapter 11 polymorphism- Questions
and Answers| Latest Update
Which of the following statements about abstract superclasses is true?


A. abstract superclasses may contain data.
B. abstract superclasses may not contain implementations of methods.
C. abstract superclasses must declare all methods as abstract.

D. abstract superclasses must declare all data members not given values as abstract. ✔️✔️A.
abstract superclasses may contain data.


Consider classes A, B and C, where A is an abstract superclass, B is a concrete class that inherits
from A and C is a concrete class that inherits from B. Class A declares abstract method
originalMethod, implemented in class B. Which of the following statements is true of class C?


A. Method originalMethod cannot be overridden in class C—once it has been implemented in
concrete class B, it is implicitly final.
B. Method originalMethod must be overridden in class C, or a syntax error will occur.
C. If method originalMethod is not overridden in class C but is called by an object of class C, an
error occurs.

D. None of the above. ✔️✔️D. None of the above.


When a superclass variable refers to a subclass object and a method is called on that object, the
proper implementation is determined at execution time. What is the process of determining
the correct method to call?
A. execution time binding.
B. execution binding.
C. just-in-time binding.

D. late binding ✔️✔️D. late binding.

, Every object in Java knows its own class and can access this information through method .


A. getClass.
B. getInformation.
C. objectClass.

D. objectInformation. ✔️✔️A. getClass.


Assigning a subclass reference to a superclass variable is safe:


A. because the subclass object has an object of its superclass.
B. because the subclass object is an object of its superclass.
C. only when the superclass is abstract.

D. only when the superclass is concrete. ✔️✔️B. because the subclass object is an object of its
superclass.


Classes and methods are declared final for all but the following reasons:


A. final methods allow inlining the code.
B. final methods and classes prevent further inheritance.
C. final methods are static.

D. final methods can improve performance. ✔️✔️C. final methods are static.


All of the following methods are implicitly final except:


A. a method in an abstract class.
B. a private method.

Document information

Uploaded on
March 21, 2025
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$9.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
KateJones
4.8
(12)
Sold
31
Followers
0
Items
5707
Last sold
1 week ago




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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions