Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

boolean error

 
Jack Sampson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic