OCPJP 6 86%
Timothy Stockdale wrote:I keep getting a message saying that "The product class is already defined".
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:This is not the right approach.
You're idea of using parallel arrays to store these values is not an easy one to maintain. If a copy of "Saw" is lost, it gets tricky on how you delete it, and deleting the last one is much trickier than deleting the 4th from last one.
The idea in OOP is that you try to model the real world with your Classes. Think about a DVD. It would have a title, a price, and perhaps an Inventory Control (IC) number. These become your class variables. A given DVD has no idea if there is another copy of it.
Olly
Olly
Timothy Stockdale wrote: What is the proper way to use that or am I going in the wrong direction? The array needs to be sorted by the name of the dvd.
Thanks in advance for the help everyone.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |