If a public class is defined in a file with the wrong filename, javac
will throw an error:
square_supplies.java:5: error: class Answer is public, should be declared in a file named Answer.java
Is there a flag to turn off this behaviour? If it's not possible for javac
, is there another java compiler where this can be turned off?