If/else staements


#1

if some one could shed some light on 7/11 section, i am suppose to get else statement to be executed

public class IfElse {
public static void main(String[] args) {

	if (7 <= 7) { true

		System.out.println("Try again...");

	} else {

		System.out.println("Success!");

	}
	
}

}

thought i could ( ! (7 <= 7) ) to make the statement false so that the ELSE statement would be executed
any thoughts?


#2

Hi @slope_starter ,

This should cause the else block to execute ...

if (!(7 <= 7)) {

But get rid of that true that you have here ...

if (7 <= 7) { true

#3

@geomaticmashups thanks that helped