Is it necessary to use Static nested class to create a node for linked list <p>Can you please describe the use of below code and how it works.</p> <pre><code>class LinkedList { Node head; // head of list static class Node { int data; Node next; Node(int d) { data = d; next=null; } // Constructor } public static void main(String[] args) { LinkedList llist = new LinkedList(); llist.head = new Node(1); Node second = new Node(2); Node third = new Node(3); llist.head.next = second; // Link first node with the second node second.next = third; // Link second node with the third node } } </code></pre>