dev/CSHARP/Lessons.md
2026-04-27 23:38:42 +05:00

416 B

=== Классы и объекты ===

Person tom = new Person(); string personName = tom.name; int personAge = tom.age; Console.WriteLine($"name: {personName} age: {personAge}");

tom.name = "Tom"; tom.age = 37; tom.Print();

class Person { public string name = "Undefined"; public int age;

public void Print()
{
    Console.WriteLine($"Имя: {name} Возраст: {age}");
}

}

=== ===