|
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();). The final part is where I'm getting a little confused. it says 'Illustrate composition by developing a third class that is used by one or both of the first classes[in my case cell/smartphone]'. I'm planning on creating a customer class that 'has-a' cell phone or smart phone. Is this what y'all think he's trying to get us to do? If i create a constructor with a cellphone argument, can I put a smartphone in there? edit: Okay, I threw the customer class together and I could use either one. I'm pretty sure I'm on the right track, but I'd still greatly appreciate any advice. PuTTY riot fucked around with this message at 21:41 on Mar 15, 2008 |
# ¿ Mar 15, 2008 21:03 |
|
|
# ¿ Apr 28, 2024 15:50 |
|
See, this is why I came in here for a second opinion. I had the right idea but I misread what he wanted us to do. Went ahead and used the phone number idea, it took some more work than the customer class, but I need an A in this class so I don't really care. Thanks for the help.
|
# ¿ Mar 16, 2008 02:40 |
|
shodanjr_gr posted:I am writing some SWING code for a UI and i have an issue. The code would probably help. Have you tried something like setLayout(new GridLayout 0,4)? If your component's size is not fixed that could have something to do with it too.
|
# ¿ May 20, 2008 21:39 |