This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "boolean error" Watch "boolean error" New topic

boolean error

Jack Sampson

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
I agree. Here's the link:
subject: boolean error
Similar Threads
Access modifiers within methods
Not knowing how to catch Errors
<identifier> expected
TextField in JTree not editable
Boolean: valueOf() and equality doubt