aspose file tools*
The moose likes Beginning Java and the fly likes Cannot invoke my set method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot invoke my set method" Watch "Cannot invoke my set method" New topic
Author

Cannot invoke my set method

Peter Hammar
Ranch Hand

Joined: Mar 01, 2010
Posts: 34


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

Any one with a good answer, please?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Help yourself, please analyze your Kolli class for method setUtensilie().
Is this method takes any argument ? Is it private ?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Peter Hammar
Ranch Hand

Joined: Mar 01, 2010
Posts: 34
Hi!

This is the method in the Kolli class:



Maybe it should take an int as an argument?

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
That isn't a "set" method at all.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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

Joined: Oct 02, 2003
Posts: 11422
    
  16


Do you really want this method to do nothing but call itself?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

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.


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
 
wood burning stoves
 
subject: Cannot invoke my set method