class if{
public static void main (String args[]){
int x = 9;
if (x <= 9){
System.out.println(\"Yay\");
}else{
if is a reserved keyword in Java (as seen in your if statement), and is thus not an eligible class name. Choose another name for your class, like IfTesting.
By convention, all class names start with an upper-case letter. The full details for what is and isn't a valid Java identifier are found in the Java Language Specification. In short, it can't be a keyword, true, false, or null.