+ 1

Scanner Objects in java code

Hello I'm new to coding and have a 2 fold query. Firstly. I have a question that asks me to create 2 scanner objects named inText and inNumber to read a text and numeric value. I begin the code with import java.util.Scanner; but where to I put the 2 scanner objects? Secondly, I need to declare a string object named customerName to store a name that uses the inText scanner mentioned with method inText.nextline(); where do I declare the new String object?

16th Mar 2018, 4:26 AM
Kieran Tobin
Kieran Tobin - avatar
2 Answers
+ 12
have a look at my answer in this post https://www.sololearn.com/Discuss/1145362/?ref=app
16th Mar 2018, 5:19 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
0
@Kieran if you're still having problem with it , then put ur code in playground and send it's link here so we could help 🙂
16th Mar 2018, 5:22 AM
Farshaad Heydari
Farshaad Heydari - avatar