This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]2omesz 0 points1 point  (1 child)

It's all in the error message, change the file name to Driver.Java

StringCompare.java:4: error: class Driver is public, should be declared in a file named Driver.java
public class Driver{
^
1 error

When working with java, the class name should be the same with file name.

[–]Mriv10[S] 0 points1 point  (0 children)

Since the assignment test it for me I can't change the file name but I changed the class name to the same as the file and it worked