Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Classes
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Player[] players = {
- new Player( "YuanZhi","BengHuaiXingQiongTieDao"),
- new Player("ZhongNi","WoT")
- };
- for (int i = 0; i < players.Length; i++)
- {
- players[i].ShowInfo();
- Console.WriteLine();
- }
- }
- }
- class Player
- {
- private string _name;
- private string _game;
- public Player(string name, string game)
- {
- _name = name;
- _game = game;
- }
- public void ShowInfo()
- {
- Console.Write($"Player: {_name}\nGame: {_game}\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement