首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

scala 函数宣言使用返回值时要用=号

2012-10-27 
scala 函数声明使用返回值时要用号class Operators{def retString():String{//有返回值return hello wo

scala 函数声明使用返回值时要用=号

class Operators{  def retString():String={//有返回值    return "hello world";  }  def echo(){//无返回值    println("hello world");  }  def echo(str:String){//带参数    println(str)  }  def echo(i:Int)(str:String){    print(i)    println(str)  }}


热点排行