Created
March 28, 2015 13:20
-
-
Save shigemk2/de8642b552d07fef1a0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
def add(x: Int, y: Int): Int = { | |
x + y | |
} | |
} | |
val a = new A() | |
println(a.add(1, 2)) | |
class B extends A { | |
override def add(x: Int, y: Int): Int = { | |
x + y + 2 | |
} | |
} | |
val b = new B() | |
println(b.add(1, 2)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment