+ 4
Multiple Java User Input
I want to make the user either type in an integer (number) or a text/word. List 1. Name1 (text1) 2. Name2 (text2) 3. Name3 (text3) User input either int (1-3) or name (name1 - name3). After typing that into the system my code displays text1 - text3. But how can the user either type in the number OR the name.
4 ответов
+ 2
You can use try and catch
+ 2
please help a newbie..I have multiple question for the user to input why is it that only one of them is outputted the first one..?? I also need an explanation to the statement " split multiple inputs in different lines"..really need help here guys.
+ 1
You can take a text input, and then perform string manipulations in it to know, whether it is an integer or a name.