フリー問題

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

問題文

A subclass declares a method that is meant to replace the behavior of one in its superclass, and the author writes the annotation for overriding above it. What does that annotation change?

選択肢

  1. It suppresses the warning that appears whenever a class hides a method that its own superclass has declared
  2. It causes the method to override the inherited one, because a method with the same name would otherwise be treated as an overload of it
  3. It marks the method so that the runtime dispatches to it dynamically, which an inherited method needs in order to behave polymorphically
  4. It asks the compiler to check that a matching method really is inherited, and it changes nothing while the program runs

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

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