CJCoding With Joseph
15free / daySign inCreate account
TitleOpen
170
Create a Simple Generic Box ClassCreate a generic class named Box<T> that stores one item.
easyNot startedSolve
171
Add a Setter to a Generic BoxComplete the setItem method so the generic Box<T> object can update its stored value after it is created.
easyNot startedSolve
172
Write a Generic Printer MethodComplete the generic static method printItem inside the Printer class.
easyNot startedSolve
173
Build a Generic Pair ClassComplete the Pair<T> class.
easyNot startedSolve
174
Create a Key Value Pair ClassComplete the KeyValuePair<K, V> class.
easyNot startedSolve
175
Return the First Item from a Generic ArrayComplete the generic method getFirst that takes an array of any type and returns its first element.
easyNot startedSolve
177
Write a Generic Method to Print Two ItemsComplete the generic static method printTwoItems that takes two values of the same type and prints each one on its own line.
easyNot startedSolve
178
Store Three Generic Items in an ArrayListComplete the method buildList so it creates an ArrayList<T>, adds the three given values in order, and returns the list.
easyNot startedSolve
180
Check If Two Generic Values Are EqualComplete the generic method areEqual that returns true if two values are equal and false otherwise.
easyNot startedSolve
181
Make a Generic Wrapper ClassComplete the Wrapper<T> class.
easyNot startedSolve
189
Return the Middle Item from Three Generic ValuesComplete the generic method getMiddle that receives three values of the same type and returns the second one (the middle parameter).
easyNot startedSolve
492
Describe a Two-Type Pair With toStringThe generic class Pair<A, B> holds two values that may be of different types, so it declares two type parameters.
easyNot startedSolve
493
Join a Key and a Value With Two Type ParametersA generic method can declare more than one type parameter.
easyNot startedSolve
494
Swap Two Slots of a Generic ArrayArrayTools.swap exchanges two elements of an array.
easyNot startedSolve
495
Wrap a Value With a Generic Factory MethodA factory method builds an object for you, so the caller never types new.
easyNot startedSolve
496
Give a Generic Maybe a Fallback ValueMaybe<T> wraps one value of any type that may be missing.
easyNot startedSolve
497
Store Items on a Generic ShelfShelf<T> keeps its items in a private ArrayList<T>, so one shelf class can hold books, scores or anything else.
easyNot startedSolve
498easyNot startedSolve
499
Pick the Larger of Two Comparable ValuesA type parameter can carry a bound.
easyNot startedSolve
500
Use a Number Bound on a Generic ClassNumberBox<T extends Number> only accepts numeric types such as Integer, Double and Long.
easyNot startedSolve
501
Implement a Generic Interface for One TypeThe generic interface Formatter<T> turns a value of type T into text.
easyNot startedSolve
176
Swap the Values in a Generic PairComplete the swap() method in the Pair<T> class so it exchanges the values of first and second.
mediumNot startedSolve
179
Count Matching Generic ValuesComplete the generic method countMatches that takes an array and a target value, then returns how many times the target appears in the array.
mediumNot startedSolve
182
Return the Last Item from a Generic ArrayListComplete the generic method getLastItem that takes an ArrayList<T> and returns the last element.
mediumNot startedSolve
183
Create a Generic Method That Repeats a ValueComplete the generic method repeatValue that takes a value and a count, then returns an ArrayList<T> containing that value repeated count times.
mediumNot startedSolve
184
Find the Index of a Generic ValueComplete the generic method findIndex that searches an array for a target value and returns the index of the first match.
mediumNot startedSolve
185
Create a Generic Student RecordComplete the StudentRecord<T, U> class.
mediumNot startedSolve
186
Copy a Generic Value into a BoxComplete the generic method copyIntoBox in the BoxTools class.
mediumNot startedSolve
187
Create a Generic Method to Print an ArrayComplete the generic method printArray that takes an array of any type and prints each element on its own line.
mediumNot startedSolve
502
Find the Largest Item in a Generic ArrayWrite a generic static method that finds the largest item in an array of any comparable type.
mediumNot startedSolve
503
Total Any List of Numbers With a Bounded WildcardA List<Integer> is not a List<Number>, so a method that takes a List<Number> refuses a list of integers.
mediumNot startedSolve
504
Count Items in a Generic TallyWrite a generic class that counts how many times each item has been added.
mediumNot startedSolve
505
Filter a Generic List With a Checker InterfaceThe generic interface Checker<T> has one method, test, that answers yes or no about a value.
mediumNot startedSolve
506
Build a Bounded Generic Range ClassWrite a generic class that represents a range between a low value and a high value.
mediumNot startedSolve
188
Build a Generic Queue with Two SlotsComplete the MiniQueue<T> class.
hardNot startedSolve