Package OOPJ_MP
Class Node<Type>
java.lang.Object
OOPJ_MP.Node<Type>
- Type Parameters:
Type
- This class is dynamic so you can Store any type of data in this class . and you have to provide that class type in this parameter Type
This is a Node class that Used to Add data into OOPJ_MP.
LinkedList
class it is like Container that carry your any type of data- Since:
- 2024
- Author:
- Mohit Makwana
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getNext()
This method returns the reference of nextNode
getValue()
This method gives the value that you store in thisNode
boolean
hasNext()
This method returns true if current Node has next Node referencevoid
This method Set value to currentNode
so you can change the value of the Node at any timetoString()
-
Constructor Details
-
Node
This constructor use to make a node with given Value Note : the Value should be as type that you specify- Parameters:
value
- Value that you want to store in theNode
-
Node
public Node()This is Default constructor
-
-
Method Details
-
hasNext
public boolean hasNext()This method returns true if current Node has next Node reference -
getNext
This method returns the reference of nextNode
-
getValue
This method gives the value that you store in thisNode
- Returns:
- Value that stores in this
Node
-
setValue
This method Set value to currentNode
so you can change the value of the Node at any time- Parameters:
value
- This is the value that you want to store in thisNode
-
equals
-
toString
-