best answer > Can we have private constructor in Java 2024?- QuesHub | Better Than Quora
  • Can we have private constructor in Java?

    函数 静态 方法

    Questioner:Amelia Wilson 2023-05-05 12:30:36
The most authoritative answer in 2024
  • Ethan Wilson——Works at SpaceX, Lives in Los Angeles. Graduated from Massachusetts Institute of Technology (MIT) with a degree in Aerospace Engineering.

    Some reasons where you may need private constructor: The constructor can only be accessed from static factory method inside the class itself. Singleton can also belong to this category. A utility class, that only contains static methods. Yes, class can have a private constructor.read more >>
    +119962023-05-11 12:30:36

About “函数、静态、方法”,people ask:

READ MORE:

QuesHub is a place where questions meet answers, it is more authentic than Quora, but you still need to discern the answers provided by the respondents.

分享到

取消