Computer Science, asked by sathish2568, 6 months ago

Write the syntax to input an integer through scanner class with an example​

Answers

Answered by shubhamkh9560
6

Answer:

please mark my answer as brainlist answer

Explanation:

Statement n = s. nextInt(); is used to input the value of an integer variable 'n' from the user. Here, nextInt() is a method of the object s of the Scanner class. Let's see an example in which we will input an integer value from the user.

Example: Program to read the number entered by user. We have ... Then we are using nextInt () method of Scanner class to read the integer. If you are ... Writing your First Java Program

Similar questions