daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Jan 16th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data class MyValue(val value: Int) {
  2.     operator fun plus(other: MyValue): MyValue {
  3.         return MyValue(value + other.value)
  4.     }
  5. }
  6.  
  7. public fun main(args: Array<String>) {
  8.     val a = MyValue(1)
  9.     val b = MyValue(2)
  10.     println(a + b)  // MyValue(value=3)
  11. }
RAW Paste Data
Top