Accountancy, asked by maniroy34, 5 months ago

can anyone tell me where to use scan.next float and where to use kb.next line in java coding and are they both same ?? if anyone gives correct answer I will surely mark him/her as brainliest...plz reply fast !! plz guys​

Answers

Answered by Itsinnoceentgirl9
1

⚪The java.util.Scanner.nextFloat method scans the next token of the input as a float.

⚪This method will throw InputMismatchException if the next token cannot be translated into a valid float value as described below.

⚪If the translation is successful, the scanner advances past the input that matched.

________________________

Declaration

Parameters

NA

Return Value

This method returns the float scanned from the input

Exception

⚪InputMismatchException − if the next token does not match the Float regular expression, or is out of range

⚪NoSuchElementException − if the input is exhausted

⚪IllegalStateException − if this scanner is closed

Hope this⤴️will help u

Similar questions