Results 1 to 3 of 3
- 09-17-2013, 04:11 AM #1Member
- Join Date
- Sep 2013
- Rep Power
Please help me to understand this question!
I'm new in java and I have a assignment and I have some questions: Under “Interfaces and Inheritance in Java”, studied about a concept called Polymorphism. How does the Bicycle-MountainBike-RoadBike example shown under the link “http://docs.oracle.com/javase/tutori...sm.html” exemplifies polymorphism. Extend the MountainBike class to create another class called DownhillMountainBike. Downhill bikes are a specialised type of mountain bike with a very strong frame, much stronger than a typical mountain bike. Create the DownhillMountainBike class with getFrameStrength(), setFrameStrength(int strength), and printDescription() methods. The frame strength is to be a value in between 1 and 10, inclusive. Test the DownhillMountainBike class using the TestBikes class from the same web link provided above.
I'm a bit confuse, so do I extend the MountainBike to create another DownhillMountainBike class. so MountainBike is like the super class for the class I have to create?, and where it says to test the DownhillMountainBike class using the TestBikes class, does this mean that am I using the same code?
I just need to understand the question, sometimes I understand something completely different and I can't fail this time!, thank you in advance.
Last edited by Dai; 09-17-2013 at 04:14 AM.
- 09-17-2013, 04:15 AM #2
Re: Please help me to understand this question!
Please do not use coloured text in your post.
Most people will not follow links.
There is plenty of information about polymorphism, inheritance and interfaces on the web and in books. Anything we post here will simply repeat what is already out there. Do some research. Then ask a specific question
- 09-17-2013, 04:17 AM #3
Re: Please help me to understand this question!MountainBike to create another DownhillMountainBike class
I understand the requirement to say "make a new special type of MountainBike called DownhillMountainBike.
so MountainBike is like the super class for the class I have to create?
test the DownhillMountainBike class using the TestBikes class, does this mean that am I using the same code?
- By Akirien in forum New To JavaReplies: 8Last Post: 08-07-2012, 07:56 PM
- By metap0d in forum New To JavaReplies: 8Last Post: 08-11-2011, 08:23 PM
- By s0meb0dy in forum AWT / SwingReplies: 2Last Post: 10-27-2010, 09:40 PM
- By jigglywiggly in forum New To JavaReplies: 14Last Post: 03-21-2010, 09:59 AM
- By Manikyr in forum New To JavaReplies: 6Last Post: 02-23-2009, 12:22 AM