Skip to content
Sharp

Modern Java · interview question

Which is a potential downside of using static factory methods extensively?

Multiple choiceMediumchapter-7-curatedpremiummodern-javastatic-factory-methods
Choose one answer
Answer and explanation

Correct answer

A. They increase the size of the API.

Why

Static factory methods increase the number of methods in the API, which can make the class appear more complex and harder to use, especially if not well-documented.

Test yourself on Modern Java

A free test with instant, explained results. No account needed.

Start free test
All Modern Java questions →