State one difference and one similarity between nextInt() and nextDouble() functions.
Answers
Answered by
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
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