java - how to call the constructor of the inner class node in Static main Function -


package practice; class linkedlist {     node head;  // head of list      /* node class */     class node     {         int data;         node next;          // constructor create new node         node(int d) {data = d; next = null; }     }     public static void main(string args[]){         linkedlist lkd=new linkedlist().new node();     } } 

it seems constructor taking 1 , 1 parameter. unless override constructor takes no parameters, try:

linkedlist.node lkd = new linkedlist().new node(**int d here**); 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -