I usually do my homework on a Java file and submit the file to complete my task, so I separate each file and contain them all in one folder. Sometimes there are two works that have the same class name, but different work. If I let two files have the same class name, they won't run properly. (I'm using vscode)
For example:
File1.java
public class File1{
public static void main(String[] args) {
...
}
}
class Fraction {...}
File2.java
public class File2{
public static void main(String[] args) {
...
}
}
class Fraction {...} //this is not the same with File1.java
Can I do anything keep two class names the same in two different files in one folder?