How to protect a class by an object creation by another class?

Answer : By making a constructor to private .

Example :
                     Class Dinesh
                {
private Dinesh(){

                // Code will be here
                       }
}

 

Comments

Popular posts from this blog

Target class controller does not exist - Laravel 8