Linked Questions

Popular Questions

For a function as below:

def reverse[T](a: Array[T]): Array[T] = {
    val b = new Array[T](a.length)
    for (i <- 0 until a.length)
        b(i) = a(a.length -i - 1)
    b
}

I am getting "error: cannot find class manifest for element type T" from line 2.

Is there anyway to solve this?

Related Questions