(String[] args)
| 3 | public class Question { |
| 4 | |
| 5 | public static void main(String[] args) { |
| 6 | Dummy bob = new Dummy("Bob", 20); |
| 7 | Dummy jim = new Dummy("Jim", 25); |
| 8 | Dummy alex = new Dummy("Alex", 30); |
| 9 | Dummy tim = new Dummy("Tim", 35); |
| 10 | Dummy maxwell = new Dummy("Maxwell", 40); |
| 11 | Dummy john = new Dummy("John", 45); |
| 12 | Dummy julie = new Dummy("Julie", 50); |
| 13 | Dummy christy = new Dummy("Christy", 55); |
| 14 | Dummy tim2 = new Dummy("Tim", 100); // This should replace the first "tim" |
| 15 | |
| 16 | Dummy[] dummies = {bob, jim, alex, tim, maxwell, john, julie, christy, tim2}; |
| 17 | |
| 18 | /* Test: Insert Elements. */ |
| 19 | Hash<String, Dummy> hash = new Hash<String, Dummy>(); |
| 20 | for (Dummy d : dummies) { |
| 21 | hash.put(d.getName(), d); |
| 22 | } |
| 23 | |
| 24 | hash.debugPrintHash(); |
| 25 | |
| 26 | /* Test: Recall */ |
| 27 | for (Dummy d : dummies) { |
| 28 | String name = d.getName(); |
| 29 | Dummy dummy = hash.get(name); |
| 30 | System.out.println("Dummy named " + name + ": " + dummy.toString()); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | } |
nothing calls this directly
no test coverage detected