Created
January 11, 2019 23:53
-
-
Save adam-arold/da8bff25a17cd5357e0dd0d33f12dc7c 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
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