kandi X-RAY | Nange Summary
kandi X-RAY | Nange Summary
个人主页,导航页展示。
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Nange
Nange Key Features
Nange Examples and Code Snippets
Community Discussions
Trending Discussions on Nange
QUESTION
I'd like to terminate the program by typing Q whenever. I can't place it in "diceChosen" because it's an integer. I've tried different things but nothing works for me.
...ANSWER
Answered 2021-Mar-07 at 22:55Since you can not use try and catch other alternative can be by changing your userInput.nextInt()
to userInput.nextLine();
so it can detect when Q is pressed if Q is not pressed then we convert String to int so it can calculate the logic with Integer.parseInt(diceChosen);
All the code
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Nange
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page