Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Basic_Task21
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player1 = new Player(1, "Первый Первович", 20);
- Player player2 = new Player(2, "Второй Второвович", 25);
- Player player3 = new Player(3, "Третий Третививич", 30);
- player1.ShowInfo();
- player2.ShowInfo();
- player3.ShowInfo();
- }
- }
- class Player
- {
- private int _id;
- private string _name;
- private int _age;
- public Player(int id, string name, int age)
- {
- _id = id;
- _name = name;
- _age = age;
- }
- public void ShowInfo()
- {
- Console.WriteLine($"{_id}. {_name} ({_age})");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement