Skip to content

Instantly share code, notes, and snippets.

@adam-arold
Created January 11, 2019 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adam-arold/da8bff25a17cd5357e0dd0d33f12dc7c to your computer and use it in GitHub Desktop.
Save adam-arold/da8bff25a17cd5357e0dd0d33f12dc7c to your computer and use it in GitHub Desktop.
interface Position {
val x: Int
val y: Int
fun calculateArea(): Int = x.times(y)
companion object {
@JvmOverloads
fun create(
x: Int,
y: Int = x): Position {
return DefaultPosition(x, y)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment