100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Comp 249 - Inheritance Questions And Answers Latest Update (2025)!! CA$23.58
Add to cart

Exam (elaborations)

Comp 249 - Inheritance Questions And Answers Latest Update (2025)!!

 0 purchase

Sure! Can you tell me a bit more about the study material? For example: Is it a textbook, notes, past exams, assignments, or a full study guide? What condition is it in? (New, lightly used, highlighted, etc.) Any special features? (Includes solutions, extra explanations, digital copy, etc.) W...

[Show more]

Preview 2 out of 5  pages

  • March 7, 2025
  • 5
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
All documents for this subject (13)
avatar-seller
Schoolflix
Q&As
2025




Comp 249 - Inheritance Questions
And Answers Latest Update
(2025)!!




What is a Covariant Return type? - Answer The superclass has
a method that returns the type superclass.

When a subclass inherits this method, you can change the return
type to a subclass of the original return type.

You couldn't change return type superclass to return type int,

you could change return type superclass to return type subclass.



Can you change the access modifiers of a METHOD with
inheritance? - Answer Yes, a subclass can make the access
modifier more inclusive (private -> public) but you CANNOT make
a method more restricted.




https://www.stuvia.com/user/schoolflix

, Q&As
2025
What is method overriding? (not to be confused with overloading)
- Answer Method Overriding is when you change the methods
definition in a subclass, but not its signature (same parameters).



What is a Method signature? - Answer A method signature is
its combination of the method name and parameter list



What is method overloading? - Answer Method Overloading is
when you override the method and change the parameters.
(Change the method signature).



When you overload a method, is the original method also
inherited? - Answer Yes! You'll have the overloaded method
and the original method which will be called depending on which
parameters are included.



What does the final modifier do on a method? - Answer
Putting final on a method means that it cannot be overwritten.
Despite this, you can overload a final method.



What does the final modifier do on a class? - Answer The final
modifier on a class means that you cannot create subclasses from
this class. (it cannot be extended)



What does the super() method do? - Answer super() calls the
constructor of the parent class, often times used to instantiate
variables of the subclass ex: super(int 1, int 2)


https://www.stuvia.com/user/schoolflix

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Schoolflix. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for CA$23.58. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

70713 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 15 years now

Start selling
CA$23.58
  • (0)
Add to cart
Added