Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlin頻出表現

 Kotlin頻出表現

Kotlinでよくつかう文/式等

TwitterID変えました。@lvla0805 -> @MoyuruAizawa

Moyuru Aizawa

November 28, 2016
Tweet

More Decks by Moyuru Aizawa

Other Decks in Programming

Transcript

  1. WBM

  2. ‣ ؔ਺ͭͷΠϯλʔϑΣʔεΛҾ਺ʹऔΔؔ਺ʹ͸ɺؔ਺Λ౉ͤ·͢ ‣ هड़ྔΊͬͪΌݮΔʜ 4". view.setOnClickListener({ view -> view.visibility =

    View.GONE }) view.setOnClickListener { view -> view.visibility = View.GONE } view.setOnClickListener { it.visibility = View.GONE }
  3. MFU

  4. ‣ FRVBMT IBTI$PEF UP4USJOH DPQZ ΛίϯύΠϧ࣌ʹੜ੒ͯ͠ ͘ΕΔ ‣ Ξοϓσʔτ͞Εͳ͍FRVBMT ͱ͞Α͏ͳΒͰ͖Δɻ

    %BUB$MBTT data class Person(val firstName: String, val lastName: String, var age: Int)
  5. ‣ ֦ுؔ਺Λ࢖ͬͯNPDLJUPΛ͍͍ײ͡ʹͯ͘͠ΕΔɻ ‣ ͜Ε΋ͳ͍ͱςετͰ͖ͳ͍ʜ LNPDLJUP var item: Item = mock()

    item.length().invoked.thenReturn(10) item.length().should be 10 item.verify().length()