フリー問題

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

問題文

An interface declares a default method, and a class implements that interface without mentioning the method at all. Which statement about the class is accurate?

選択肢

  1. It inherits the body from the interface and it is free to override that body later, and an instance of the class can be asked to run the method right away
  2. It has to supply its own body for that method, because a class that implements an interface has to implement every method that the interface declares
  3. It inherits the method but is unable to change the behavior, because a default body is fixed once the interface has declared it
  4. It inherits the method as an abstract one, so the class itself has to be declared abstract until some body for that method is supplied

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

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