6. if statement .. help


#1

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

	if(3 > 2){    
		System.out.println("Access granted.");
	}
}

}

provide if statement with a Boolean expression that evaluates to true.

why it is not work ?


#2

Your if and your main method is O.K. :wink:. But the definition and the name of your class is wrong.
"public class Ifpublic class If " a class name in Java starts with a capital letter and has no spaces. So it would like something like this public class Test{}. and not public class ifpublic class if{}. :slightly_smiling:


#3

how can you write a if statement with boolean expression that evaluates to true