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 week it?"); day= console.nextstring (); } }//end public class
when go compile error(
code:
pizzastore.java:14: cannot find symbol symbol : method nextstring() location: class java.util.scanner day= console.nextstring (); )
i have same code in program use (except fact type int instead) , works fine. because of string. don't know , plain annoying. can explain why is?
scanner doesn't have nextstring() method. though have next() method.
reference: http://docs.oracle.com/javase/6/docs/api/java/util/scanner.html#next()
Forums Macs Mac Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment