他の人が書いていたら読めるけれども、知らなければ書けない定型的なソースコードの型を集めているので気が向いたら書いていく。ダジャレが好きなので、コード型ログと呼ぶ。今回は1回目。 無限ループを持つスレッドはinterrupt()で止められるようにする。 package org.example.katalog; public class InterruptSample { public static void main(String[] args) { Thread t = new Thread() { @Override public void run() { // interruptされるまで、"Hello world"を出力し続ける。 // なお、isInterrupted()は呼ぶとフラグがクリアされてfalseになる。 while (!isInterrupted()) { Syste