Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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
Sheriff
Posts: 48454
56
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic