Main.java:3: class TEST is public, should be declared in a file named TEST.java public class TEST ^ 1 error
Remove public before class
write
class TEST
rather than
public class TEST
1 Like
if class declare public then its a obligation of java to have same name of class to the name of file u saved.but if declare not public then compiler will compile the file .
2 Likes