Return to site

☕🎓JAVA CERTIFICATION QUESTION: interface modifier

· ocp,java

Which modifiers are prohibited in interface methods when utilizing Java 17 among the provided options?

* final

* static

* private

* protected

* default

#java #certificationquestion #ocp Answer: final, protected

According to the Java SE 17 documentation, the prohibited modifiers in interface methods are final and protected.

The modifiers that are allowed in interface methods are public, private, abstract, default, static, and strictfp.

NB: Thanks Lew for his expert eye (see comments).

https://www.udemy.com/course/ocp-oracle-certified-professional-java-developer-prep/?referralCode=54114F9AD41F127CB99A

Answer: final, protected

According to the Java SE 17 documentation, the prohibited modifiers in interface methods are final and protected.

broken image

NB: Thanks Lew for his expert eye (see comments).