Welcome to Java! This Nodes are like a blocks, they must be assembled to do amazing things! In this particular case, your nodes can represent a list, a linked list, You can see an example here:

public class ItemLinkedList {
    private ItemInfoNode head;
    private ItemInfoNode tail;
    private int size = 0;

    public int getSize() {
        return size;
    }

    public void addBack(ItemInfo info) {
        size++;
        if (head == null) {
            head = new ItemInfoNode(info, null, null);
            tail = head;
        } else {
            ItemInfoNode node = new ItemInfoNode(info, null, tail);
            this.tail.next =node;
            this.tail = node;
        }
    }

    public void addFront(ItemInfo info) {
        size++;
        if (head == null) {
            head = new ItemInfoNode(info, null, null);
            tail = head;
        } else {
            ItemInfoNode node = new ItemInfoNode(info, head, null);
            this.head.prev = node;
            this.head = node;
        }
    }

    public ItemInfo removeBack() {
        ItemInfo result = null;
        if (head != null) {
            size--;
            result = tail.info;
            if (tail.prev != null) {
                tail.prev.next = null;
                tail = tail.prev;
            } else {
                head = null;
                tail = null;
            }
        }
        return result;
    }

    public ItemInfo removeFront() {
        ItemInfo result = null;
        if (head != null) {
            size--;
            result = head.info;
            if (head.next != null) {
                head.next.prev = null;
                head = head.next;
            } else {
                head = null;
                tail = null;
            }
        }
        return result;
    }

    public class ItemInfoNode {

        private ItemInfoNode next;
        private ItemInfoNode prev;
        private ItemInfo info;

        public ItemInfoNode(ItemInfo info, ItemInfoNode next, ItemInfoNode prev) {
            this.info = info;
            this.next = next;
            this.prev = prev;
        }

        public void setInfo(ItemInfo info) {
            this.info = info;
        }

        public void setNext(ItemInfoNode node) {
            next = node;
        }

        public void setPrev(ItemInfoNode node) {
            prev = node;
        }

        public ItemInfo getInfo() {
            return info;
        }

        public ItemInfoNode getNext() {
            return next;
        }

        public ItemInfoNode getPrev() {
            return prev;
        }
    }
}

EDIT:

Declare ItemInfo as this:

public class ItemInfo {
    private String name;
    private String rfdNumber;
    private double price;
    private String originalPosition;

    public ItemInfo(){
    }

    public ItemInfo(String name, String rfdNumber, double price, String originalPosition) {
        this.name = name;
        this.rfdNumber = rfdNumber;
        this.price = price;
        this.originalPosition = originalPosition;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRfdNumber() {
        return rfdNumber;
    }

    public void setRfdNumber(String rfdNumber) {
        this.rfdNumber = rfdNumber;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getOriginalPosition() {
        return originalPosition;
    }

    public void setOriginalPosition(String originalPosition) {
        this.originalPosition = originalPosition;
    }
}

Then, You can use your nodes inside the linked list like this:

public static void main(String[] args) {
    ItemLinkedList list = new ItemLinkedList();
    for (int i = 1; i <= 10; i++) {
        list.addBack(new ItemInfo("name-"+i, "rfd"+i, i, String.valueOf(i)));

    }
    while (list.size() > 0){
        System.out.println(list.removeFront().getName());
    }
}
Answer from David Pérez Cabrera on Stack Overflow
🌐
Java Code Geeks
examples.javacodegeeks.com › home › java development › core java
Java Node Example - Java Code Geeks
September 20, 2021 - A Node class can be customized to store one or more data fields & pointer links inside each of the individual objects.
🌐
Codecademy
codecademy.com › learn › getting-started-with-data-structures-java › modules › nodes-java › cheatsheet
Getting Started With Data Structures: Nodes Cheatsheet | Codecademy
A Node constructor should take in data as a variable. Our implementation had data as a String, but it could also be an int or float, etc. The constructor should then: set the data instance variable to the passed in data variable ... A Java Node class has a .setNextNode() method that takes in a Node and updates the next instance variable appropriately.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › org › w3c › dom › Node.html
Node (Java Platform SE 8 )
July 21, 2026 - Returns the DOMUserData associated to the given key on this node, or null if there was none. ... Java™ Platform Standard Ed. 8 ... Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
🌐
University of Colorado Boulder
home.cs.colorado.edu › ~main › docs › edu › colorado › nodes › Node.html
Node
Compute the number of nodes in a linked list. ... A wrong answer occurs for lists longer than Int.MAX_VALUE. public static <E> java.lang.Object[] listPart(Node<E> start, Node<E> end)
🌐
GitHub
github.com › joeferner › node-java
GitHub - joeferner/node-java: Bridge API to connect with existing Java APIs. · GitHub
If you want the defacto standard ... set java.asyncOptions. If you do provide asyncOptions, be aware that this module will not generate method variants of a given flavor if you don't provide a string value for the corresponding suffix (asyncSuffix, syncSuffix, promiseSuffix). In the example above, the application is configured to omit the method variants using node-style async ...
Author: joeferner
Top answer
1 of 1
11

Welcome to Java! This Nodes are like a blocks, they must be assembled to do amazing things! In this particular case, your nodes can represent a list, a linked list, You can see an example here:

public class ItemLinkedList {
    private ItemInfoNode head;
    private ItemInfoNode tail;
    private int size = 0;

    public int getSize() {
        return size;
    }

    public void addBack(ItemInfo info) {
        size++;
        if (head == null) {
            head = new ItemInfoNode(info, null, null);
            tail = head;
        } else {
            ItemInfoNode node = new ItemInfoNode(info, null, tail);
            this.tail.next =node;
            this.tail = node;
        }
    }

    public void addFront(ItemInfo info) {
        size++;
        if (head == null) {
            head = new ItemInfoNode(info, null, null);
            tail = head;
        } else {
            ItemInfoNode node = new ItemInfoNode(info, head, null);
            this.head.prev = node;
            this.head = node;
        }
    }

    public ItemInfo removeBack() {
        ItemInfo result = null;
        if (head != null) {
            size--;
            result = tail.info;
            if (tail.prev != null) {
                tail.prev.next = null;
                tail = tail.prev;
            } else {
                head = null;
                tail = null;
            }
        }
        return result;
    }

    public ItemInfo removeFront() {
        ItemInfo result = null;
        if (head != null) {
            size--;
            result = head.info;
            if (head.next != null) {
                head.next.prev = null;
                head = head.next;
            } else {
                head = null;
                tail = null;
            }
        }
        return result;
    }

    public class ItemInfoNode {

        private ItemInfoNode next;
        private ItemInfoNode prev;
        private ItemInfo info;

        public ItemInfoNode(ItemInfo info, ItemInfoNode next, ItemInfoNode prev) {
            this.info = info;
            this.next = next;
            this.prev = prev;
        }

        public void setInfo(ItemInfo info) {
            this.info = info;
        }

        public void setNext(ItemInfoNode node) {
            next = node;
        }

        public void setPrev(ItemInfoNode node) {
            prev = node;
        }

        public ItemInfo getInfo() {
            return info;
        }

        public ItemInfoNode getNext() {
            return next;
        }

        public ItemInfoNode getPrev() {
            return prev;
        }
    }
}

EDIT:

Declare ItemInfo as this:

public class ItemInfo {
    private String name;
    private String rfdNumber;
    private double price;
    private String originalPosition;

    public ItemInfo(){
    }

    public ItemInfo(String name, String rfdNumber, double price, String originalPosition) {
        this.name = name;
        this.rfdNumber = rfdNumber;
        this.price = price;
        this.originalPosition = originalPosition;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRfdNumber() {
        return rfdNumber;
    }

    public void setRfdNumber(String rfdNumber) {
        this.rfdNumber = rfdNumber;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getOriginalPosition() {
        return originalPosition;
    }

    public void setOriginalPosition(String originalPosition) {
        this.originalPosition = originalPosition;
    }
}

Then, You can use your nodes inside the linked list like this:

public static void main(String[] args) {
    ItemLinkedList list = new ItemLinkedList();
    for (int i = 1; i <= 10; i++) {
        list.addBack(new ItemInfo("name-"+i, "rfd"+i, i, String.valueOf(i)));

    }
    while (list.size() > 0){
        System.out.println(list.removeFront().getName());
    }
}
🌐
Medium
javafullstackdev.medium.com › java-nodes-explained-essential-building-blocks-for-linked-lists-trees-and-graphs-93b1163f922e
Java Nodes Explained: Essential Building Blocks for Linked Lists, Trees, and Graphs | by fullstackjavadev.in | Medium
June 2, 2024 - When diving into the world of data structures in Java, you’ll frequently encounter the term “node.” A node serves as a fundamental element or building block in various data structures such as linked lists, trees, and graphs. This blog will take a detailed look at what a node is and how it functions in different data structures, including code examples ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-program-for-inserting-a-node-in-a-linked-list
Java Program For Inserting A Node In A Linked List - GeeksforGeeks
July 23, 2025 - For example, if the given Linked List is 10->15->20->25 and we add an item 5 at the front, then the Linked List becomes 5->10->15->20->25. Let us call the function that adds at the front of the list is push(). The push() must receive a pointer ...
Find elsewhere
🌐
GitHub
github.com › joeferner › node-java › blob › master › README.md
node-java/README.md at master · joeferner/node-java
If you want the defacto standard ... set java.asyncOptions. If you do provide asyncOptions, be aware that this module will not generate method variants of a given flavor if you don't provide a string value for the corresponding suffix (asyncSuffix, syncSuffix, promiseSuffix). In the example above, the application is configured to omit the method variants using node-style async ...
Author: joeferner
🌐
University of Alberta
sites.ualberta.ca › ~rosanna › books › PDSA › chapter5 › node.html
But First, What is a Node? — Practices in Data Structures and Algorithms with Java
Let’s make three nodes to hold names and link them together. Here is the potential Java code: Node<String> node1 = new Node<>("Santa Claus"); Node<String> node2 = new Node<>("Tooth Fairy"); Node<String> node3 = new Node<>("Mickey Mouse"); node1.setNext(node3); node3.setNext(node2);
🌐
CodeSandbox
codesandbox.io › examples › package › node-java
node-java examples - CodeSandbox
Use this online node-java playground to view and fork node-java example apps and templates on CodeSandbox.
🌐
University of Hawaii
www2.hawaii.edu › ~walbritt › ics211 › examples › Node.java
/ A generic Node class that Stores a reference to Data and the next Node
private T data; // next points to the next node private Node next; · public Node(T data2, Node next2) { data = data2; next = next2; }
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › org › w3c › dom › Node.html
Node (Java Platform SE 7 )
Returns the DOMUserData associated to the given key on this node, or null if there was none. ... Java™ Platform Standard Ed. 7 ... Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
🌐
Virginia Tech
courses.cs.vt.edu › ~cs2114 › Fall2015 › CarranoDataStructures › JavaDocs › bag › Node.html
Node
java.lang.Object · bag.Node<T> Type Parameters: T - Type of object held inside of the Node · public class Node<T> extends java.lang.Object · Node To be used when implementing Carrano Data structures with a singly linked list. Might be used for BagInterface, or SimpleBagInterface.
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.xml › org › w3c › dom › Node.html
Node (Java SE 21 & JDK 21)
January 20, 2026 - While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised.
🌐
GitHub
github.com › MarkusJx › node-java-bridge
GitHub - MarkusJx/node-java-bridge: A bridge between Node.js and Java · GitHub
The pre-compiled binaries will be provided with the package, the only thing you need to do on your machine is install a Java Runtime Environment (JRE) for this package to use. In contrast to other node.js <-> java interfaces, the binary is not hard linked to the JDK it has been compiled with but rather loads the jvm native library dynamically when the program first starts up.
Author: MarkusJx
🌐
Medium
medium.com › srmkzilla › using-a-java-snippet-from-inside-of-node-js-fe0366f48ee4
Using a Java Snippet from inside of Node.js | by Aniruddha Chatterjee | SRMKZILLA | Medium
July 14, 2020 - We shall be using Node.js as our primary program, and a simple, tiny Java Snippet to perform some actions. You do not need to know any Java. The snippet is simple enough to understand if you know the basics of programming.
🌐
GeeksforGeeks
geeksforgeeks.org › node.js › how-to-run-java-code-in-node-js
How to Run Java Code in Node.js ? - GeeksforGeeks
July 23, 2025 - This article will guide you through the steps required to execute Java code from a Node.js application, covering various methods and tools available to facilitate this integration.
🌐
Oracle
docs.oracle.com › cd › B14099_19 › web.1012 › b12024 › org › w3c › dom › Node.html
Node (Oracle® XML Java API Reference)
The name of this node, depending on its type; see the table above. public java.lang.String getNodeValue() throws DOMException