> ## Documentation Index
> Fetch the complete documentation index at: https://docs.baenninger.me/llms.txt
> Use this file to discover all available pages before exploring further.

# Methoden

Eine Klasse kann auch Methoden beinhalten. Diese Methoden können auch mit den [Fields und Properties](/dotnet/c/objektorientierte-programmierung/fields-und-properties) interagieren.

```csharp theme={null}
class Person
{
    public string Name { get; set; }
    public DateOnly DateOfBirth { get; set; }
    
    public void PrintInfo() 
    {
        Console.WriteLine($"Name: {Name}");
        PrintSeparator();
        Console.WriteLine($"Date of birth: {DateOfBirth}");
    }
    
    private void PrintSeparator()
    {
        Console.WriteLine("----------------------------");
    }
}
```
