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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -