フリー問題

Java SE 17 Developer のフリー問題 8 / 20 問目

問題文

A record is declared inside an interface so that the two live together. What is true about that declaration?

選択肢

  1. The record has to be declared public, because a member of an interface is unable to carry a narrower access level than the interface itself
  2. The record is unable to implement the interface that contains it, because a type is not allowed to depend on its own enclosing declaration
  3. The record is implicitly static, so it needs no instance of the interface and is used through the name of the interface itself
  4. The record is an inner type of the interface, so an instance of it belongs to an implementation of that interface

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

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