Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • what is the correct way ? should the Node be defined as Node<Item> ? Commented Jul 30, 2013 at 12:19
  • 1
    I take back what I said, I didn't look at your code precisely enough and posted a wrong comment. Commented Jul 30, 2013 at 12:23
  • I think the Node class should be a generic class just like the containing class. By the way, Oracle recommends using a single uppercase letter as a generic type name. It can be useful to follow these conventions. Commented Jul 30, 2013 at 12:29
  • 1
    @Tamás: The node class is a private inner class of MyLList, so it can use the generic type of MyLList, and doesn't need to be generic itself. Commented Jul 30, 2013 at 12:31
  • @jlordo: Yes, you are right. To be honest, I wasn't sure whether the inner class can use the generic type of the containing class. Commented Jul 30, 2013 at 12:45