[Solved] I don’t understand why a class is “public” [duplicate]


The purpose of public and private on a class differs from that on methods.

Classes (C# Programming Guide)

public class Customer
{
    //Fields, properties, methods and events go here...
}

The class keyword is preceded by the access level. Because public is
used in this case, anyone can create objects from this class.

Access Modifiers (C# Programming Guide)

public class Bicycle
{
    public void Pedal() { }
}

The type or member can be accessed by any other code in the same
assembly or another assembly that references it.

3

solved I don’t understand why a class is “public” [duplicate]