File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 37913
    
  22
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: 11152
    
  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%|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot invoke my set method
 
Similar Threads
Can we override static method
static generic class
How many string object created in this code
Displaying a please wait message while processing
passed 81%