Mac annoying Java compiling issue.

Hylekmi

macrumors regular
Original poster
Dec 8, 2010
101
0
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?
 
Last edited by a moderator:

dauber

macrumors regular
Jan 10, 2012
141
17
Chicago
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.
 

Hylekmi

macrumors regular
Original poster
Dec 8, 2010
101
0
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.
 
Last edited:

yg17

macrumors G5
Aug 1, 2004
14,935
2,534
St. Louis, MO
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.
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.