问题
Been a while since I used java. I want to use Java's built in linkedlist class but I want a custom node class that has children and siblings. How can I write a custom node class that Java's linked list will use? Just a matter of creating the node class and declaring a linkedlist class but just create a new constructor that will override javas? Thanks!
回答1:
LinkedList uses a private Node<E> class internally. If this is just an academic exercise, given that the source code is available you could just start with that and go from there.
来源:https://stackoverflow.com/questions/44360545/custom-node-class-with-javas-linkedlist-class