string identifier symbol not found
I am new to java. I am working with this one .java file shown here, and for some reason the identifier location is not a found symbol
Code :
import java.lang.String;
class FishSpot
{
public static void main (String args[])
{
String locaton;
location = "Corson's Inlet";
if (location != "")
System.out.print("Fishing Spot: " + location);
}
}
and here's the error message when compiling with javac in command prompt:
Quote:
C:\Program Files\Java\src\com\scjaexam\ex2_4>javac Pseudo2_4.java
Pseudo2_4.java:10: cannot find symbol
symbol : variable location
location: class FishSpot
location = "Corson's Inlet";
^
Pseudo2_4.java:11: cannot find symbol
symbol : variable location
location: class FishSpot
if (location != "")
^
Pseudo2_4.java:12: cannot find symbol
symbol : variable location
location: class FishSpot
System.out.print("Fishing Spot: " + location);
^
3 errors
Thanks in advance for your help.
Re: string identifier symbol not found
This is a fun spot the difference game in real life. A quick spell check will tell you what's wrong, if you haven't gotten this worked out yet.
Re: string identifier symbol not found
Quote:
Originally Posted by
KucerakJM
This is a fun spot the difference game in real life. A quick spell check will tell you what's wrong, if you haven't gotten this worked out yet.
Awwwwww man!! slaps forehead! lol I can't believe I didn't see that. thanks!