Results 1 to 3 of 3
Thread: Reading characters into a string
- 03-08-2011, 08:14 PM #1
Member
- Join Date
- Mar 2011
- Posts
- 48
- Rep Power
- 0
Reading characters into a string
I am wanting to enter the name "Smith" into String name.
Java Code:while(counter <= 3) { name = in.next(); wages = scan.nextDouble(); hoursWorked = scan.nextDouble();
I keep getting the error:
Lab8.java:41: cannot find symbol
symbol : variable in
location: class Lab8
name = in.next();
^
With the carrot pointing at the in.
What can/should I do?
EDIT: I'm sorry, I didn't realize that between the text book style and my own that "in.next" in the text book is "scan.next" for me.Last edited by Teclis; 03-08-2011 at 08:19 PM.
- 03-08-2011, 08:34 PM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Mark your thread solved with the thread tools if you are done. Also check out the scanner nextLine method.
- 03-08-2011, 10:08 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 48
- Rep Power
- 0
Similar Threads
-
Two '\n' characters between lines while reading File
By subith86 in forum New To JavaReplies: 6Last Post: 02-26-2011, 09:56 AM -
Reading Characters from a ByteBuffer
By Dan0100 in forum New To JavaReplies: 2Last Post: 09-20-2010, 10:05 PM -
Scanner reading accented characters
By Phenomena in forum New To JavaReplies: 2Last Post: 04-29-2010, 04:06 PM -
Reading characters without showing up on the screen?
By alexsb92 in forum New To JavaReplies: 11Last Post: 03-28-2010, 08:08 PM -
writing and reading unicode characters from a file
By ranoosh in forum Advanced JavaReplies: 4Last Post: 09-28-2008, 04:34 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks