File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ""if" statment question  " Watch ""if" statment question  " New topic
Author

"if" statment question

G. Graz
Ranch Hand

Joined: Oct 23, 2006
Posts: 30
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 :
Janeice DelVecchio
Saloon Keeper

Joined: Sep 14, 2009
Posts: 1613
    
  10

Pretty sure you can.


When you do things right, people won't be sure you've done anything at all.
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
Yes you can. That's a common and acceptable idiom.

John.
G. Graz
Ranch Hand

Joined: Oct 23, 2006
Posts: 30
OK, great ! Thank you so much !
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: "if" statment question
 
Similar Threads
thread question
Threading q
Collections
Design Pattern Needed
Question about sunchronized of thread