Skip to content

Instantly share code, notes, and snippets.

@vvviiimmm
Created February 19, 2017 19:54
Show Gist options
  • Select an option

  • Save vvviiimmm/52e43b5290753b624ef41ff2ea880d2b to your computer and use it in GitHub Desktop.

Select an option

Save vvviiimmm/52e43b5290753b624ef41ff2ea880d2b to your computer and use it in GitHub Desktop.
trait Shape {
def area: Double
def info: String
}
class Circle(radius: Double) extends Shape {
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