what is the impact of private constructor job java interview question

preview_player
Показать описание

What is the impact of "private constructor" ? Java Interview Question and Answer :

What is the impact of "private constructor" ?

Private constructors prevent a class from being explicitly instantiated by callers.

Public class privateConstDemo {
private privateConstDemo () {
...
}
}

* It is used in creating "Singleton Design Pattern".

You can submit your resume for right Job

Рекомендации по теме