Question
Why can't we assign a base class object to a derived class variable?
Step 1
This means that a derived class object can be used wherever a base class object is expected. This is known as "upcasting". However, the reverse is not true. A base class object cannot be assigned to a derived class variable because the derived class may have Show more…
Show all steps
Your feedback will help us improve your experience
Aditya Sood and 71 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
A class from which an object cannot be instantiated could be a(n): a. base class b. derived class c. implemented class d. virtual class e. abstract class
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD