[ERROR TEMPLATE] Java - class <class name> is public, should be declared in a file named <class name>.java
nedpals opened this issue · 0 comments
nedpals commented
Name | Type | Code | Language |
---|---|---|---|
class is public, should be declared in a file named .java | Compile-time Error | java.lang.PublicClassFilenameMismatchError | Java |
Description
The public class needs to be in a file with the same name in Java.
Sample Code
public class Right {
public static void main(String[] args) {
}
}
Sample Error Message
Wrong.java:1: error: class Right is public, should be declared in a file named Right.java
public class Right {
^
1 error
Implementation Checklist
- Implemented analysis
- Implemented explanation translation
- Implemented bug fix generation
- Add tests