Scala代码报错 type mismatch
猿来是我 2015-06-25 12:02:28 object testFun {
def methodA(x:Int) {
if (x>100)
println("greater than 100")
else
println("not greater than 100")
}
def apply7(f: Int => {}) {
print("go")
f(120)
}
def main(args:Array[String]) = {
apply7(methodA)
}
}
以上Scala代码报错:
prog.scala:38: error: type mismatch;
found : Unit
required: AnyRef
求帮助解决。