Please answer as soon as possible
What's the contents of newNumbers after the following code is executed?
val numbers = Array(2.5, 1, 3.2, 9.3, 2, 9, 1.5) val newNumbers = numbers.map(_.toInt)
According to the code provided above,
The newNumbers will get a map of integer values after conversion of float to int by toInt method.
Explanation:
I hope the above information and explanation will help you out to understand!
Please comment if you have any queries/errors!
Thank you!
Get Answers For Free
Most questions answered within 1 hours.