|
-
Feb 15th, 2005, 09:34 AM
#1
Thread Starter
Addicted Member
Help with inheritance....
My teacher in Advanced Java class gave us an assignment on inheritance yesterday, and it is due tomorrow. We just started learning about this and I am not totally sure how to do it, I dont know even if I am doing it right. I would like some help with this assignment if thats alright with everyone.
Because pasting all of my code here in the forums would be very long, i decided to add them to this message in a zip file. I will be working on this continously all day and checking here periodically. Any help would be appreciated.
BTW:the text below is what we are supposed to do in the assignment.
Create an inheritance hierarchy for the program from Assignment 2. Make the Product class the abstract super class. Create classes for movie DVDs and music CD objects. The CD object includes the artist and the number of tracks. The DVD object includes the director. Each has a playing time value as well. Change the ProductList class to include these objects instead of the generic Product objects, if needed.
Include in the Product class a showInfo() method. Return a String which includes the data from the Product object. In the subclasses override this method to return all the data.
Write a test class to show polymorphism by retrieving Products from the ProductList object and executing the showInfo() method for each. Use a loop.
Last edited by NoteMe; Feb 17th, 2005 at 06:54 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|