This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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 invoke my set method

 
Peter Hammar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


setUtensilie( int) cannot invoke setUtensilie() in Kolli is the error I get.

Any one with a good answer, please?
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help yourself, please analyze your Kolli class for method setUtensilie().
Is this method takes any argument ? Is it private ?
 
Peter Hammar
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

This is the method in the Kolli class:



Maybe it should take an int as an argument?

 
Campbell Ritchie
Sheriff
Posts: 48440
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That isn't a "set" method at all.
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Hammar wrote:This is the method in the Kolli class:



Maybe it should take an int as an argument?

Peter, why don't you try out your doubt.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12086
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Do you really want this method to do nothing but call itself?
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Hammar wrote:Hi!

This is the method in the Kolli class:



Maybe it should take an int as an argument?



In which class this method belongs to? And if that method, doesn't expect any arguments, then you can't give it. And check in that class, whether there are any other overloaded method, which takes int as argument? After all, in your method, you call itself, ultimately, there will be a StackOverFlowException.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic