Computer Science, asked by vihant2943e, 14 hours ago

State one difference and one similarity between nextInt() and nextDouble() functions.​

Answers

Answered by nicolejessica6atam
1

Answer:

The hasNextInt() is used to check if there are any more elements left and the nextInt() is used to access that element

The nextDouble() is a method of Java Scanner class which is used to scan the next token of the input as a double. If the translation is successful, the scanner past the input that matched.

Answered by Roumak18
2

Answer:

nextInt() reads the next integer value

nextDouble() reads the next double value

Both are inbuilt functions of the Scanner class

Please mark me as brainliest!

Similar questions