Search⌘ K
AI Features

Access Modifier

Explore the four access modifiers in C#—public, internal, protected, and private. Understand how each modifier controls access to class members within the same class, derived classes, or assemblies, helping you manage data encapsulation and security in your C# programs.

Access modifiers control how information can be accessed. There are four types of access modifiers in C#.

  1. Public
  2. Internal
  3. Protected
  4. Private

The public access modifier

The elements defined with a public ...