Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
In this video, we'll review the solution to the first challenge and introduce our second challenge—adding behaviors to the MediaType base class.
Instructions
2nd Challenge
Move the
Loan()
andReturn()
methods and theLoanee
andOnLoan
fields from the Album subclass to the MediaType base class.Add a
GetDisplayText()
method to any media type subclass that currently doesn't define that method.-
To test your changes...
- Ensure that you're instantiating an instance of each of your media type subclasses in the Program.cs
Main()
method. - Call the
Loan()
andReturn()
methods on each media type subclass instance. - Call the
GetDisplayText()
method (on each media type subclass instance) after calling theLoan()
andReturn()
methods.
- Ensure that you're instantiating an instance of each of your media type subclasses in the Program.cs
Abstract Members
For more information about abstract classes and class members in C# see the Intermediate C# course in the Treehouse library.
Help
If you get stuck on any of the following topics or simply need a refresher, click on a topic in list below to view the associated video in the C# Objects course.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up