This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Compile Errors - Head First - GuessGame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compile Errors - Head First - GuessGame" Watch "Compile Errors - Head First - GuessGame" New topic
Author

Compile Errors - Head First - GuessGame

Temmu Smith
Greenhorn

Joined: May 21, 2010
Posts: 4
I've created 3 .java files - 1 compiles, 2 give errors.
The folder that the .java files are in is part of the PATH statement, as is the location of the \BIN folder.
All 3 .java files are in the same directory.
Error messages posted after each .java file.

I have read the other 3 threads about this program - does not seem applicable - but, I'm just learning.
Advice greatly appreciated!

GameLauncher.java - does NOT compile:



c:\some\path\here>javac GameLauncher.java
.\GuessGame.java:6: error: <identifier> expected
Public void StartGame()
^
.\GuessGame.java:6: error: invalid method declaration; return type required
Public void StartGame()
^
.\GuessGame.java:6: error: cannot find symbol
Public void StartGame()
^
symbol: class Public
location: class GuessGame
GameLauncher.java:6: error: cannot find symbol
game.startGame();
^
symbol: method startGame()
location: variable game of type GuessGame
4 errors




Player.java DOES compile




GuessGame.java does NOT compile:



c:\some\path\here>javac GuessGame.java
GuessGame.java:6: error: <identifier> expected
Public void StartGame()
^
GuessGame.java:6: error: invalid method declaration; return type required
Public void StartGame()
^
2 errors
lokesh sree
Ranch Hand

Joined: Oct 27, 2009
Posts: 99

Hi,
Java IS case sensitive. So, "Public" is not the same as the actual java keyword "public". This should solve some of your issues here.


Lokesh
( SCBCD 5, CCENT, SCJP 5 )
Temmu Smith
Greenhorn

Joined: May 21, 2010
Posts: 4
lokesh chenta wrote:Hi,
Java IS case sensitive. So, "Public" is not the same as the actual java keyword "public". This should solve some of your issues here.


Thanks! OK, did that, now I only get this:
(I know game must be the game in the line above it in GameLauncher - it is there, but the compiler says it can't find it: )

Is this something that is so obvious I should "just see it" or "jsut get it?"

c:\some\path\here>javac GameLauncher.java
GameLauncher.java:6: error: cannot find symbol
game.startGame();
^
symbol: method startGame()
location: variable game of type GuessGame
1 error
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
Again case sensitive - StartGame() and not startGame()
Temmu Smith
Greenhorn

Joined: May 21, 2010
Posts: 4
John Jai wrote:Again case sensitive - StartGame() and not startGame()


Thanks, John. So sorry, how embarrassing, am told by someone look at CASE SENSITIVITY and there is my problem again.
I trust I'll not repeat that one again!

Thanks again, Lokesh and John!
 
jQuery in Action, 2nd edition
 
subject: Compile Errors - Head First - GuessGame
 
Similar Threads
GuessGame Errors From Head First Java
Head First Java Ch. 2 Compile error
Please Help with Guessing Game (Head First Java)
GuessGame.java:2: cannot resolve symbol
Very new to java