Skip to content

Instantly share code, notes, and snippets.

@Strelok78
Created June 4, 2025 18:32
Show Gist options
  • Select an option

  • Save Strelok78/cfa583eff30fa0a5219291facf684e11 to your computer and use it in GitHub Desktop.

Select an option

Save Strelok78/cfa583eff30fa0a5219291facf684e11 to your computer and use it in GitHub Desktop.
class and properties lesson
using System;
using System.IO;
namespace iJunior_Practice
{
class Program
{
static void Main(string[] args)
{
Player player = new Player("Ivan", 30);
player.ShowInfo();
}
}
class Player
{
public Player(string name, int age)
{
Name = name;
Age = age;
}
public string Name
{
get;
}
public int Age
{
get;
}
public void ShowInfo()
{
Console.WriteLine($"Name: {Name}, Age: {Age}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment