Skip to content

Instantly share code, notes, and snippets.

@Attosius
Last active December 4, 2025 19:00
Show Gist options
  • Select an option

  • Save Attosius/8c8eff37f3b4c623f3d9215c4a80b7c6 to your computer and use it in GitHub Desktop.

Select an option

Save Attosius/8c8eff37f3b4c623f3d9215c4a80b7c6 to your computer and use it in GitHub Desktop.
ДЗ: Работа с классами
using System;
namespace IJuniorTasks
{
internal class Program
{
static void Main(string[] args)
{
var player = new Player("Player1", 10, 5);
player.ShowInformation();
}
}
public class Player
{
private string _name;
private int _damage;
private int _speed;
public Player(string name, int damage, int speed)
{
_name = name;
_damage = damage;
_speed = speed;
}
public void ShowInformation()
{
Console.WriteLine($"Name: {_name}, Damage: {_damage}, Speed: {_speed}");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment