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
Post a Comment