在类或对象体中,这适用:
def a(s:String) {} def a(s:Int) {}
但是如果将它放在另一个方法中,它就不会编译:
def something() { def a(s:String) {} def a(s:Int) {} }
为什么会这样?
scala
scala ×1