annoying Java compiling issue.

Discussion in 'Mac Programming' started by Hylekmi, Jan 23, 2012.

  1. Hylekmi, Jan 23, 2012
    Last edited by a moderator: Jan 24, 2012

    macrumors regular

    Joined:
    Dec 8, 2010
    #1
    Code:
    import java.util.Scanner;
    
    public class PizzaStore
    {
    	public static void main(String[]args)
    		{
    			Scanner console = new Scanner (System.in);
    			
    			String day;
    			
    			
    			
    			System.out.println ("What day of the week is it?");
    			day= console.nextString ();
    		}
    }//end public class
    
    


    When i go to compile this i get the error(

    Code:
    PizzaStore.java:14: cannot find symbol
    symbol  : method nextString()
    location: class java.util.Scanner
    			day= console.nextString ();
    )
    I have the same code in another program i use (except for the fact that its type Int instead) and it works fine. It could be because of the String. I just don't know and its just plain annoying. Can anyone explain why this is?
     
  2. macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #2
  3. macrumors member

    dauber

    Joined:
    Jan 10, 2012
    Location:
    Chicago
    #3
    Trust me, use an IDE. I used to code Java manually, but I started using Eclipse at the urging of my Java instructor last quarter and it's been a godsend. Chances are it would have given you a suggestion to basically follow jiminaus's advice.
     
  4. Hylekmi, Jan 24, 2012
    Last edited: Jan 24, 2012

    thread starter macrumors regular

    Joined:
    Dec 8, 2010
    #4
    I am going to try to get an IDE when i have more time. I am currently swamped with homework and i have to stick with TextWrangler for the time being.
     
  5. macrumors G5

    yg17

    Joined:
    Aug 1, 2004
    Location:
    St. Louis, MO
    #5
    It takes a few minutes to download Eclipse and even less time to set it up. In the amount of time it took you to make this thread and wait for an answer, you would've solved your problem if you had a proper IDE.
     

Share This Page