Scala 返回多个值
class A{
var c
var d
def return={ (c,d,"soyo") //以元组形式返回 }
}
调用:
val s=new A
var(a1,a2,a3)=s.return
var s2=s.return
prinln( s2._1,s2._2,s2._3)
class A{
var c
var d
def return={ (c,d,"soyo") //以元组形式返回 }
}
调用:
val s=new A
var(a1,a2,a3)=s.return
var s2=s.return
prinln( s2._1,s2._2,s2._3)