3. Name the method of Scanner class that is :
als used to input an integer data from the standard input stream.
h is used to input a string data from the standard input stream.
Answers
Answered by
3
Answer:
1. scanner.nextInt()
Explanation:
2. scanner.next()
Answered by
0
Answer: Sacnner.nextInt() is used to take the integer value from the user.
Scanner.nextLine() method is used to take string input from the user.
Explanation:
nextInt() and nextLine() are the methods of Java.util.Scanner class.
The nextInt() method takes the input of data in a string format and converts it into the integer type. The scanner object reads the characters one by one.
The nextLine() method takes the string input from the user. This method is also defined in the java.util.scanner class. The nextLine() method reads the text till the line end. The cursor gets placed to the next line when it reads the line completely.
Similar questions