Created
February 19, 2017 20:07
-
-
Save vvviiimmm/60314fc5fe1e4e82b0ebdca3e5d229a0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| trait Shape { | |
| def area: Double | |
| } | |
| trait Printable { | |
| def info: String | |
| } | |
| class Circle(radius: Double) extends Shape with Printable { | |
| override def area: Double = math.Pi * math.pow(radius, 2) | |
| override def info: String = s"Hi, I'm a circle with radius $radius" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment