C Sharp - private instance and public instanceI have class named(productdetails) , in that i am implementing singleton DP, now the doubt is
private static ShoppingCart ShoppingCartInstance;
public static ShoppingCart GetShoppingCart()
if (ShoppingCartInstance == null)
ShoppingCartInstance = new Business.ShoppingCart();
why i am making one private instance and public instance, instead of writing private instance i can write directly public instance.
why i need this private instance.