reset password
Author Message
Anonymous
Posts: 166
Posted 16:01 Apr 05, 2014 |

so for the homework, we can't modify the classes so I thought of adding something like a tester to each class with list arrays is that fine, also keenan can you post how you initialized the array

kknaur
Posts: 540
Posted 16:04 Apr 05, 2014 |

Well first off, you don't (and shouldn't) need a tester for each class.  You have each individual class and the classes are sort of "combined" once you create the final Computer object after getting all the user input and making the Computer based on the parts that the person chose.

You only need one Tester/Driver/Main class for the entire program. 

Also, what array are you talking about?  You can just make an array of whatever part type you want, or you may use an ArrayList.  See the example code at the end of the lecture notes.

Anonymous
Posts: 166
Posted 16:19 Apr 05, 2014 |

I said make a tester for each one because in class you showed us how to use the ArraryList to put all the information in there, and the class name was main. so we can just add the ArrayList to the classes you already made.

kknaur
Posts: 540
Posted 16:26 Apr 05, 2014 |

You can use an ArrayList for each part to store the different types of parts sure, but you don't need a tester for each class, you just have one main method and your ArrayLists should be in the class with the main method unless you add an Inventory class like I did.

Anonymous
Posts: 166
Posted 16:37 Apr 05, 2014 |

ok I understand now, thank you