Instead of filling in a String or another type we use the command “System.in” to obtain data from a user. This looks like this:
- scanner in a method
- scanner in constructor
In these two examples, we asked the input from the user. If you want to know how to fill in the input yourself (the programmer) or ask it from a file, check the following links:
- Click here if you want to get input from the programmer
- Click here if you want to get input from a file