Private constructor and public parameter constructor -C#
- by Amutha
I heard that private constructor prevent object creation from outside world.
When i have a code
public class Product
{
public string Name { get;set;}
public double Price {get;set;}
Product()
{
}
public Product(string _name,double _price)
{
}
}
here still i can declare public constructor(parameter),won't it spoil the…