What is the difference between the different overriding methods in Scala?
问题 Scala lets you override a method in two legal ways: Given super class: class A { def a = "A" } We can override the method "a" by: class B extends A { override def a = "B" } and class B extends A { override def a() = "B" } both seem to override the method "a" correctly. What is the design decision behind this? Why allow for "a()" in B to override "a" in A? 回答1: This hasn't always been the case (from the change log of the language specification): Scala version 2.0 also relaxes the rules of