• Post Reply Bookmark Topic Watch Topic
  • New Topic

"if" statment question  RSS feed

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to pass Boolean method as a parameter of another Boolean methods “if” statement ?. Basically I want to have a “if” statement execute if the parameter ( in this case the other Boolean method) is true. Something to this effect :
 
Bartender
Posts: 1812
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pretty sure you can.
 
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can. That's a common and acceptable idiom.

John.
 
G. Graz
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, great ! Thank you so much !
 
Marshal
Posts: 57238
175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean to use the return value of a boolean method as an expression. You don't call it a parameter there.

Note this alternative version of your code
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!