So, I'm quite confused by AbstractList and I'm working on an assignment for a class. Basically what we're doing is creating a catalog for a library where it will store the information such as title, ISBN, etc.
I am getting all the information in correctly and creating objects in the appropriate classes, but I don't know how to work AbstractList very well. Here's what I have so far...
BookList.java
[CODE ]import java.util.*;
import java.io.*;
import containers.AbstractList;
public abstract class BookList<Element> extends AbstractList<Object> {
public int size () {
return this.size();
}
}[/CODE]
And this is inside ListEngine.java
My problem is coming from:
Here is what Eclipse is telling me:
Thanks for any help provided!
I am getting all the information in correctly and creating objects in the appropriate classes, but I don't know how to work AbstractList very well. Here's what I have so far...
BookList.java
[CODE ]import java.util.*;
import java.io.*;
import containers.AbstractList;
public abstract class BookList<Element> extends AbstractList<Object> {
public int size () {
return this.size();
}
}[/CODE]
And this is inside ListEngine.java
Code:
ListEngine engine = new ListEngine();
BookList blist = new BookList<ListEngine>();
My problem is coming from:
Code:
BookList blist = new BookList<ListEngine>();
Here is what Eclipse is telling me:
Multiple markers at this line
- BookList is a raw type. References to generic type BookList<Element>
should be parameterized
- Line breakpoint:ListEngine [line: 181] - main(String[])
- Cannot instantiate the type BookList<ListEngine>
Thanks for any help provided!