Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ООП
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player1 = new Player("Max", 20);
- player1.ShowInfo();
- }
- }
- class Player
- {
- public string Name { get; private set; }
- public int Age { get; private set; }
- public Player(string name, int age)
- {
- Name = name;
- Age = age;
- }
- public void ShowInfo()
- {
- Console.WriteLine($"Меня зовут {Name}, мне {Age}.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement