我写了这个方法:
public def getXScaleFactor(panelWidth: Int): Double = {
return (panelWidth / (samplesContainer[0].length.asInstanceOf[Double]))
}
我在编译时遇到问题:
[error] ./src/main/scala/Controllers/TrackController.scala:85: ';' expected but 'def' found.
[error] public def getXScaleFactor(panelWidth: Int): Double {
[error] ^
这段代码有什么问题?