I am new to java. I am trying a simple game with three classes SimpleDotComGame, SimpleDotCom, GameHelper in three different .java files all put together in a directory dotGame. SimpleDotComGame.java has the main method. I have declared package name as
in each of these files. SimpleDotCom.java and GameHelper.java compile without any errors. But when I run SimpleDotComGame.java I get the following error:
I get the same error for SimpleDotCom class as well. Please help me with the same.
There is something very peculiar. Replace the package name and use a Scanner to read through the file.
I’ll see if I can create something which will do that.Now copy the entire text of this post into a file; it’s easy enough to do it.
Give it some name like “oddCharacters.txt”.
See whether there are any characters which aren’t standard ASCII. It is possible you have a peculiar character adjacent to the keyword class causing it to be misread.
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Programmatically Create PDF Using Free Spire.PDF with Java