java - How to create an instance of a class nested within Static class which is in turn nested within Non-Static class? -


how create instance of node in following?

public class removedups_1{      public static class linkedlist{          static int = 5;          class node{          }     } } 

i think strange way work objects, if interested create instance of node class achieve in way:

removedups_1.linkedlist linkedlist = new removedups_1.linkedlist(); removedups_1.linkedlist.node node = linkedlist.new node(); 

source: oracle documentation nested classes


Comments