This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Cannot find symbol class  RSS feed

 
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
package dotGame should be package dotGame; <-- notice the ; at the end.
 
Shikha Upadhyaya
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have added the semicolon. The error still persists.
 
Shikha Upadhyaya
Ranch Hand
Posts: 70
Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, I got the solution. The code started working fine when I removed
from all the three classess!

But I didn't get the reason why!
 
Marshal
Posts: 60749
189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!