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


small programming question here.

i'm trying line 43

system.out.print("please enter manufacturer of doughnut:");  

user input paste directly line 46

system.out.print("please enter manufacturer of doughnut:");  

but compiler keeps giving me error:

exception in thread "main" java.util.inputmismatchexception @ java.util.scanner.throwfor(scanner.java:864) @ java.util.scanner.next(scanner.java:1485) @ torus.main(torus.java:46)

for example, if user wanted input doughnuts mcdonald's, line 46 automatically spit out mcdonald's.

my java code

well input.nextdouble() compiler expecting double-datatype. need string manufacturer. think input.nextline() should it.


Comments