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 Need help to set a string value using a setmethod if condition is true Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Need help to set a string value using a setmethod if condition is true " Watch "Need help to set a string value using a setmethod if condition is true " New topic
Author

Need help to set a string value using a setmethod if condition is true

zub kodi
Greenhorn

Joined: Jan 23, 2008
Posts: 5
I am new to java and need some help. I want to set a string value called "LMP LIMITED" using a setMetho if it passed an if statement.

I have two files called company.java and companyDetails.java

I have the following method in company.java file

now in my companyDetails.java file,

I have a if statement that checks if stupplier varified and if it is then return the name of the supplier which is LMP Limited. From the basic knowledge I have, I implemented the following code:
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by zub kodi:
...I get an error cannot resolve symbol method setSupplier(java.lang.String)...

What is the type of "companyInfo"? The type of this reference should be the class in which the method "setSupplier" is defined. (Or if you are overriding the method, it could also be a supertype of that class.)

I see that setSupplier is in the file company.java, so I might assume that the class is also "company." But whatever that class is called, that should be the type of the variable "companyInfo."


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
vatsalya rao
Ranch Hand

Joined: Feb 14, 2007
Posts: 63
As Mark pointed it out,check the type of the variable "Company info"

and also check that you have written a method setSupplier which takes a String as parameter.

You might have written setSupplier with any other paramater.
 
jQuery in Action, 2nd edition
 
subject: Need help to set a string value using a setmethod if condition is true
 
Similar Threads
about inner join and inner join fetch again
A really silly problem .But cant figure out how ?
EJP's @RolesAllowed({""})
How to set default argument value when using Spring constructor injection
Passing a String by reference