Java scanner close system in We can use this class to read input from a user or a file.