• Welcome to Web Hosting Community Forum for Webmasters - Web hosting Forum.
 

Recommended Providers


Jetpack
Fully Managed WordPress Hosting
lc_banner_leadgen_3
Fully Managed WordPress Hosting

WordPress

WordPress Hosting Divi WordPress Theme
WPZOOM
Bluehost WordPress Hosting

Forum Membership

Forum Membership

What is a Private Constructor in programming?

Started by grofee, December 27, 2022, 12:41:06 PM



grofee


thmueller78

The main difference between public and private there is that other classes cannot create instances from the class with a private constructor.

Akshay_M

A private constructor is a special instance constructor. It is generally used in classes that contain static members only. If a class has one or more private constructors and no public constructors, other classes (except nested classes) cannot create instances of this class.


WordPress Hosting