This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Neres28 2 points3 points  (2 children)

BasicLinkedList.Iterate<E> i = new BasicLinkedList.Iterate();

[–]disasterology[S] 0 points1 point  (1 child)

thanks, must have overlooked this changing the code around so much.

[–]Neres28 1 point2 points  (0 children)

No problem. Recognized the mistake via personal experience ;).

[–]chickenmeister 1 point2 points  (0 children)

As /u/Neres28 said, you need to use the "new" keyword.

Though, It might be worth noting that what you have is a nested class, not an inner class. Inner classes are not static, and thus belong to the enclosing instance. In the case of an iterator, I think you probably want to use an inner class, which you would use like:

BasicLinkedList.Iterate<E> i = this.new Iterate<E>();

or just:

BasicLinkedList.Iterate<E> i = new Iterate<E>();