Friday, April 19, 2019

java.util.scanner - Java Code User Input to System.out

Small programming question here.



I'm trying to get line 43



System.out.print("Please Enter the Manufacturer of Your Doughnut:"); 



user input to paste directly into line 46



System.out.print("Please Enter the Manufacturer of Your Doughnut:"); 


but my compiler keeps giving me this error:




Exception in thread "main" java.util.InputMismatchException at

java.util.Scanner.throwFor(Scanner.java:864) at
java.util.Scanner.next(Scanner.java:1485) at Torus.main(Torus.java:46)




For example, if the user wanted to input that their doughnuts were from McDonald's, line 46 would automatically spit out McDonald's.



My Java Code

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...