Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What is the difference between these two class declarations?
- public class OrderedList<E extends Comparable<E>>
- public class OrderedList<E extends Comparable>
- //==========================================================================
- //Node Class
- //==========================================================================
- static class Node<E>
- {
- public E info;
- public Node nextNode;
- public Node(E info)
- {
- this.info = info;
- nextNode = null;
- }
- public int compareTo(Node<E> e)
- {
- if ((Integer) this.getInfo() > (Integer) e.getInfo())
- {
- return 1;
- }
- if ((Integer) this.getInfo() < (Integer) e.getInfo())
- {
- return -1;
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement