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 - An Individual Node in java is a class that is used to create the individual data holding blocks for various data structures, which organize data in a nonsequential fashion.
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());
    }
}
Discussions

Need guidance on creating Node class (java)? - Stack Overflow
You should probably run the code as well rather than guessing. 2017-01-30T09:21:07.083Z+00:00 ... Hum... right, i can't figure out why it does work, but, i'll edit my answer. Thanks. 2017-01-30T09:24:41.267Z+00:00 ... The node class that will be implemented changes according to the linked list ... More on stackoverflow.com
🌐 stackoverflow.com
Node in java?
A "node" is not really a specific thing, but a generalized concept; like you said, there are linked list nodes, tree nodes, graph nodes, etc. They follow a similar structure, but not exactly, so you aren't likely to find a one-size-fits-all class for them. If you want a linked list or a tree, use the container classes the stdlib provides. Don't try and roll your own but still pull in bits of the stdlib that weren't really designed with this in mind. If you want to build your own containers, then build them on your own. More on reddit.com
🌐 r/learnprogramming
3
2
November 17, 2021
Java Node class for a Graph - Code Review Stack Exchange
I'm using ArrayList to store adjacent nodes, and ArrayList to store the corresponding weights of the vertices. Is this efficient if I only use it for small inputs? Is it More on codereview.stackexchange.com
🌐 codereview.stackexchange.com
January 16, 2018
[Java] Trying to create a binary search tree with java and unsure how to create nodes for it. Am i making the nodes like linked-lists?
Could just make a node class with left and right children, both of which are nodes. A node should also have a field to determine the key of the node you're looking at. I'm assuming you know how to make classes, btw More on reddit.com
🌐 r/learnprogramming
17
2
March 17, 2019
🌐
University of Colorado Boulder
home.cs.colorado.edu › ~main › docs › edu › colorado › nodes › Node.html
Node
public class Node<E> extends java.lang.Object · A Node provides a generic node for a linked list. Each node contains a piece of data (which is a reference to an E object) and a link (which is a reference to the next node of the list). The reference stored in a node can be null.
🌐
University of Colorado Boulder
home.cs.colorado.edu › ~main › edu › colorado › nodes › Node.java
// File: Node.java from the package edu.colorado.nodes
* * @note * Lists of nodes can be made of any length, limited only by the amount of * free memory in the heap. But beyond Integer.MAX_VALUE (2,147,483,647), * the answer from listLength is incorrect because of arithmetic * overflow. * @see * * Java Source Code for this class * (www.cs.colorado.edu/~main/edu/colorado/nodes/Node.java) * * @author Michael Main * (main@colorado.edu) * * @version Feb 10, 2016 * * @see BooleanNode * @see ByteNode * @see CharNode * @see DoubleNode * @see FloatNode * @see IntNode * @see LongNode * @see ShortNode */ public class Node ·
🌐
Vias
vias.org › javacourse › chap14_02.html
Java Programming Course - The Node Class
January 24, 2011 - As usual when we write a new class, we'll start with the instance variables, one or two constructors and toString so that we can test the basic mechanism of creating and displaying the new type · The declarations of the instance variables follow naturally from the specification, and the rest ...
Find elsewhere
🌐
Virginia Tech
courses.cs.vt.edu › ~cs2114 › Fall2015 › CarranoDataStructures › JavaDocs › bag › Node.html
Node
All Classes · Summary: Nested ... 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....
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › org › w3c › dom › Node.html
Node (Java Platform SE 8 )
July 21, 2026 - The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children.
🌐
DEV Community
dev.to › dhanush9952 › data-structures-creating-custom-node-classes-1e8
Data Structures: Creating Custom Node Classes - DEV Community
October 25, 2024 - Software Developer | Java, Spring Boot, Hibernate, Junit | FSD 🌐RestAPI, Micro Services | 60k+ Reads | Freelance Content Writer | Book Author ... Creating a node class based on the problem is crucial. 👉This post will guide you how to create a node class which is essential in writing complex algorithms and effecient code implementations.
🌐
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
/** * This Is A "Mutator" Method - Used To Set A Data Field. * * @param next2 is a pointer to the next node.
🌐
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 - Nodes in a binary tree are structured as follows: public class TreeNode { int data; TreeNode left; TreeNode right; // Constructor public TreeNode(int data) { this.data = data; this.left = null; this.right = null; } }
🌐
Williams College
cs.williams.edu › ~bailey › JavaStructures › doc › structure5 › structure5 › Node.html
structure5 Class Node<E>
java.lang.Object structure5.Node<E> public class Node<E> extends java.lang.Object · A class supporting a singly linked list element. Each element contains a value and maintains a single reference to the next node in the list. protected E data · The data value stored in this node.
🌐
Williams College
cs.williams.edu › ~bailey › JavaStructures › doc › structure › structure › Node.html
Node
java.lang.Object structure.Node · public class Node · extends java.lang.Object · A class supporting a singly linked list element. Each element maintains a single reference to the next node in the list. protected java.lang.Object data · The data value stored in this node.
🌐
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 - ... // A complete working Java program to // demonstrate all insertion methods // on linked list class LinkedList { // head of list Node head; // Linked list Node class Node { int data; Node next; Node(int d) { data = d; next = null; } } // Inserts ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › implementing-a-linked-list-in-java-using-class
Implementing a Linked List in Java using Class - GeeksforGeeks
July 11, 2025 - Since a Linked List is typically represented by the head pointer of it, it is required to traverse the list till the last node and then change the next to last node to the new node. Implementation: Java · import java.io.*; // Java program to implement // a Singly Linked List public class LinkedList { Node head; // head of list // Linked list Node.
🌐
javaspring
javaspring.net › blog › java-node-class
Mastering Java Node Class: A Comprehensive Guide — javaspring.net
In this example, the Node class has an integer data field to store the information and a next field of type Node to point to the next node in the list.