フリー問題

Java SE 8 Programmer II のフリー問題 10 / 20 問目

問題文

A generic class tries to give itself a class level variable whose declared type is one of its own type parameters. Why is that declaration rejected?

選択肢

  1. It is rejected because a single copy is shared by objects made from differing arguments so the compiler has nothing to settle on.
  2. It is rejected because a single copy is shared by instances holding a wildcard captured at a call so the compiler has nothing to settle on.
  3. It is rejected because a single copy is shared by threads running inside a pool so the compiler has nothing to settle on.
  4. It is rejected because a single copy is shared by subclasses that declare a narrower bound so the compiler has nothing to settle on.

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

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