I don't know how to fix this code. It "explodes" somewhere in returnFirstString but I don't know why. Also, I don't know how to properly display result using println. Is this approach ok.
So here's the code:
def returnFirstString(a: Array[String]): Option[String]=
{
if(a.isEmpty) { None }
Some(a(0))
}
val emptyArrayOfStrings = Array.empty[String]
println(returnFirstString(emptyArrayOfStrings))