In coming up with a solution to this I noticed a lot of annoying errors that had to do with string casing. We probably should allow for case insensitivity in our spell checking. The problem here is the generic parameter <E> in our chapter 24 sample code. As far as java is concerned it considers <E> as a raw object. A raw object has an equals method, but no concept of equalsignorecase. We need to tell java to assume <E> will be a string so we can use the equalsignore case method. Here is the easiest way to fix this:
In your MyLinkedList class, define it as follows:
public class MyLinkedList<E extends String> extends MyAbstractList<E> {
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Get Free Quote!
289 Experts Online