I wrote this method:
public def getXScaleFactor(panelWidth: Int): Double = {
return (panelWidth / (samplesContainer[0].length.asInstanceOf[Double]))
}
and I have problems with compilation:
[error] ./src/main/scala/Controllers/TrackController.scala:85: ';' expected but 'def' found.
[error] public def getXScaleFactor(panelWidth: Int): Double {
[error] ^
What is wrong in this code?
public
is not a reserved word in Scala, so it's interpreting it as a variable name. Public access is the default; just leave off public
and you'll be fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With