Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot find symbol constructor Node(int,Node)

 
davidson johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to create a linked queue and wanted to test the insertion. But,on compililng, I'm getting this error:

cannot find symbol constructor Node(int,Node)

Here's my program:




And here's my node class:


Can anyone help me with this?
 
Gabor Kovacs
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


They aren't constructors. They are methods with a constructor name. Delete the "void" return type.

//sorry for my english
 
davidson johnson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works. Thanks a lot man!
 
Campbell Ritchie
Marshal
Posts: 52664
122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Gabor Kovacs

Thank you for pointing out that error; it is not a rare error to add a return type to what ought to be a constructor.
 
mooooooo ..... tiny ad ....
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!