|
American Jello posted:OK, I know homework questions are frowned upon here, but I just want to make sure I'm on the right track. We are supposed to create a real-world entity, then make a subclass that is a specialized form of that entity. I've got both of those done. (CellPhone and SmartPhone, smart phone having data minutes in addition to regular minutes and all the other stuff cell phone has via super(). If the third class needs to 'be used' by one of the first two, a Customer would 'use' a phone, rather than than a phone 'using' a customer. So you might make a class for a phone number and say that they both 'use' a phone number, or a web browser, which only the smart phone uses. But I doubt that's the important part. I think what you're supposed to understand is the difference between having an instance of a class (customer has a phone), and being an instance of a class (smart phone is a cell phone). You also might be making this more complex than it really is, because it sounds like you have it down just fine.
|
# ¿ Mar 16, 2008 00:06 |
|
|
# ¿ Apr 28, 2024 17:46 |