How to pass an object to a method in Scala

后端 未结 4 677
清酒与你
清酒与你 2021-01-18 21:46

How can I pass the reference of an object to method in Scala? E.g. I want this to compile

object Constants {
  val constantA:Double = ???
}


def calc(number         


        
4条回答
  •  無奈伤痛
    2021-01-18 22:32

    Look at the synthax of your method definition: what does your calc method produce ? Unit ? Int ? I suggest that you review the basics of the Scala synthax first

提交回复
热议问题