Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data class MyValue(val value: Int) {
- operator fun plus(other: MyValue): MyValue {
- return MyValue(value + other.value)
- }
- }
- public fun main(args: Array<String>) {
- val a = MyValue(1)
- val b = MyValue(2)
- println(a + b) // MyValue(value=3)
- }
Add Comment
Please, Sign In to add comment