I'm having this problem which I'm not sure why it's caused.
"class Account is public, should be declared in a file named Account.java"
I have 5 classes in my program, all in the same file and all are public:
- Class called Main which includes the main method
- Class called Account is abstract
- 3 classes Account1, Account2, Account3 which extend the abstract class
I named my file Main.java, and it's giving me this error. Then I named my file Account.java, and I got the same error again.
What should I do?
You should split up your file into 5 files so that you only have one class per file.