class Person { private string name; public void SetName(string newName) { name = newName; } }
class Animal { protected string sound; public void MakeSound() { Console.WriteLine(sound); } } class Dog : Animal { public Dog() { sound = "Bark"; } }
internal class MyClass { public void SayHello() { Console.WriteLine("Hello"); } }
class Animal { protected internal string sound; } class Cat : Animal { public Cat() { sound = "Meow"; } }
public class Calculator { public int Add(int a, int b) { return a + b; } }All of these examples are part of the standard .NET library, which is included with the .NET Framework.