This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman 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 Building Microservices this week in the Design 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
Have you checked out Aspose?
subject: boolean error
It's not a secret anymore!