Scanner class is used to read input. — Scanner scan = new Scanner(System.in);
This is the general syntax for reading from stain using the scanner class. This can be accessed using variable name scan. And don't forget to close it after reading input.
scan.close();
We use cookies to understand our websites traffic and offer our website visitors personalized experience. To find out more, click ‘More Information’. In addition, please, read our
Privacy policy.