Somehow I missed this, but Java already has pattern matching for switch as a standard feature since Java 21. Pattern matching itself simplifies type checks, and also allows you to cast an object in a ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する