xxxxxxxxxx
// Define a class
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
// Create an instance of the class using object initializer
Person person = new Person
{
Name = "John",
Age = 30
};
// Access the properties
Console.WriteLine($"Name: {person.Name}, Age: {person.Age}");