scala怎样实现一个自定义的类
发布网友
发布时间:2022-05-01 02:32
我来回答
共1个回答
热心网友
时间:2022-06-22 14:46
定义数组:
val
active = Array.fill(numRuns)(true)
val
costs = Array.fill(numRuns)(0.0)
var
activeRuns =
new
ArrayBuffer[Int] ++ (0
until numRuns)
自定义类型:
type
WeightedPoint
= (Vector, Long)
def
testType(): Unit ={
type
WeightedPoint