フリー問題

Java SE 25 Developer Professional のフリー問題 5 / 20 問目

問題文

A sealed interface permits two record classes, and a switch expression over that interface omits the default label. Why does the code compile?

選択肢

  1. The compiler establishes exhaustiveness from the permitted subtypes, so it considers the absent fallback branch defective in this situation.
  2. The compiler establishes exhaustiveness from the permitted subtypes, so it considers the absent fallback branch permissible in this situation.
  3. The compiler establishes exhaustiveness from the loaded subtypes, so it considers the absent fallback branch defective in this situation.
  4. The compiler establishes exhaustiveness from the loaded subtypes, so it considers the absent fallback branch permissible in this situation.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。