Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: string identifier symbol not found

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation 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

    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:

    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.


  2. #2
    Member
    Join Date
    Mar 2012
    Location
    United States
    Posts
    118
    My Mood
    Inspired
    Thanks
    1
    Thanked 33 Times in 31 Posts

    Default 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.

  3. #3
    Junior Member
    Join Date
    Nov 2011
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: string identifier symbol not found

    Quote Originally Posted by KucerakJM View Post
    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!

Similar Threads

  1. java.lang.IllegalArgumentException: Identifier not found
    By aussiemcgr in forum What's Wrong With My Code?
    Replies: 9
    Last Post: March 9th, 2012, 04:48 AM
  2. Remaining compile errors: no suitable method found for & cannot find symbol
    By ChuckLep in forum What's Wrong With My Code?
    Replies: 4
    Last Post: December 12th, 2011, 03:33 PM
  3. [SOLVED] Found String Requires Double Problem.
    By NPotter86 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 17th, 2011, 01:24 PM
  4. <identifier> expected
    By Trunk Monkeey in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 21st, 2010, 09:33 PM
  5. Replies: 2
    Last Post: November 3rd, 2009, 06:28 AM