wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes boolean error 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 "boolean error" Watch "boolean error" New topic
Author

boolean error

Jack Sampson
Greenhorn

Joined: May 08, 2008
Posts: 2
Hi. I need to return a boolean true if the Author's name is present in the sample text and boolean false if it doesn't. However, when testing I get the error "authorInReport(java.lang.String) in Report cannot be applied to ()
if (r.authorInReport()) {"

Here's what I have:


What am I missing, or what have I done wrong here so that it won't return true if an Author's name is present in sample text?

Thanks for any help given and p.s I'm very new to this
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
The posted code indicates that authorInReport takes a String patameter. But this line from the error message indicates you are trying to call the method with no parameters.



A legal call of the method would read:




By the way, Welcome to Javaranch.


Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: boolean error
 
Similar Threads
Access modifiers within methods
TextField in JTree not editable
Not knowing how to catch Errors
<identifier> expected
Boolean: valueOf() and equality doubt