Multi-file execution

Report a typo

You are given two files in the same folder:

// Alpha.java
public class Alpha {
    public static void main(String[] args) {
        Beta.greet();
    }
}
// Beta.java
public class Beta {
    public static void greet() {
        System.out.println("Hello from Beta!");
    }
}

What is the correct command to run this program directly without explicitly compiling it first?

Enter a short text

Create a free account to access the full topic