Computer Science, asked by SƬᏗᏒᏇᏗƦƦᎥᎧƦ, 4 months ago

How does scanner class works Explain.

Answers

Answered by Anonymous
2

The Scanner class is mainly used to get the user input, and it belongs to the java. util package. In order to use the Scanner class, you can create an object of the class and use any of the Scanner class methods. In the below example, I am using the nextLine() method, which is used to read strings.

Explanation:

hope it helps you

Answered by ⲎσⲣⲉⲚⲉⲭⳙⲊ
23

\huge\mathcal{\orange{\underline{\overline{\mid{\blue{Answer}}\mid}}}}

\blue{✦✧✦━━━━━━━━━━━━━━━━━━━}

Scanner is a class in java. util package used for obtaining the input of the primitive types like int, double, etc. and strings. It is the easiest way to read input in a Java program, though not very efficient if you want an input method for scenarios where time is a constraint like in competitive programming.

\blue{━━━━━━━━━━━━━━━━━━━✦✧✦}

\pink{➢Hope\:It\:Helps࿐}

Similar questions