問題一覧へ ラムダ式 基礎

ラムダ式がキャプチャできる変数

次のコードをコンパイルするとどうなりますか。

public class Main {
  public static void main(String[] args) {
    int count = 0;
    Runnable r = () -> System.out.println(count);
    count++;
    r.run();
  }
}

選択肢