Skip to content

[OTHER] is there any one can explain why SinglyLinkedList extends Node? #4326

@doxxx93

Description

@doxxx93

What would you like to share?

public class SinglyLinkedList extends Node {
    private Node head;
    private int size;

    class Node {

    int value;
    Node next;
    }
}

Additional information

I think LinkedList and Node is has-a relation, not is-a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions