How to use java to make a guessing game programming
Tools/Materials
Install JDK or MyEclipse
Methods/Steps
1
Import Scanner class, set up java external framework and java program entry to create Scanner object, object name is in
2
The system outputs the content, then the system receives your punch and the system punches itself
3
Then match the numbers you enter with the switch multi-branch structure
4
The result is analyzed and output with if conditional statement
5
This can only run once and end, so you want to set an infinite loop, you can control the exit program
6
Let's run it and see what happens
Matters needing attention
Learn more about the if structure while loop switch multi-branch structure random() function