Scala programming language is based on Java that enables it to be interoperable with java. As Scala code is compiled to bytecode which is the same as compiled by java.
List of Floats in Java
It is simply, a list in java that contains elements of float data type.
Syntax to create a list of float in java,
List<float> floatList = new ArrayList<float>()
Syntax to create a list of float in Scala,
val floatList = new java.util.ArrayList[Float]()
Indexed Sequence
It is a subtrait of the trait sequence that returns a vector which allows random and fast access to the elements.
Program to convert java list of floats to an Indxed Sequence in Scala
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer