0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

kotlin - 関数の引数がラムダ式の場合のラムダ式の型の見方、関数の使い方

Posted at

kotlinの関数の引数でラムダ式が使われているときの見方が、最初分からなかったので自分用にメモ( ..)φメモメモ

関数の表し方(前提知識的なの)

2024-11-13_00h44_03.png

関数の引数がラムダ式の場合(本題)

2024-11-13_01h30_11.png

関数の引数がラムダ式の場合の関数の使い方

2024-11-13_01h49_28.png

このtest2()を使う時に、ラムダ式の引数name: Stringに値を入れたい場合

2024-11-13_02h05_57.png

実際のサンプルコード↓

メモ

メソッドの戻り値Unitは、空という意味(Javaのvoidと同じ)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?