title: How to change the node in the built-in java LinkedList class to add a right and down pointer?
body: <p>I have started to use Java. I want to use the built-in Java LinkedList class with my custom node class (my node class will contain fields: data, down pointer, right pointer). Is it possible to do so?</p>
  
  <p>Here is my node class: </p>
  
  <pre><code>public class Node {
  int data;
  Node rt;
  Node dw;
  
  //constructor
  public Node(int dataValue) {
      rt=null;
      dw=null;
      data=dataValue;
  }
  //methods:
  public int getData() {
      return data;
  }
  
  public void setData(int dataValue) {
      data = dataValue;
  }
  
  public void setrt(Node nextVal) {
      rt=nextVal;
  }
  
  public void setdw(Node nextVal) {
      dw=nextVal;
  }
  
  public Node getrt() {
      return rt;
  }
  
  public Node getdw() {
      return dw;
  }
  </code></pre>
  
  <p>I created the following instance:</p>
  
  <p>LinkedList h = new LinkedList&lt;>();</p>
  
  <p>I want to implement a 2D linked list using the built-in linked list class in java. To be able to do this i want to implement my custom node.</p>