I'm currently trying to help someone fix some bugs in his game and I'd like some clarification on the usage of "If" statements in Java (even if you don't know Java, the function is essentially the same throughout most programming languages).
I am wondering if the if statements can be written like this:
I am wondering if the if statements can be written like this:
As opposed to this:If ("boolean expression")
{
//code
}
Is the "== true" required when checking a boolean expression (and will the code execute if the boolean expression returns true, but not false?). Rep+ for anybody who can shed some light on this topic!If ("boolean expression" == true).
{
//code
{