Как обратиться к переменной в get set - C#
Формулировка задачи:
Листинг программы
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- getiset a = new getiset ();
- Console.WriteLine(a.Popular);
- Console.ReadLine();
- }
- }
- class getiset
- {
- public string Popular { get; set; }
- public getiset()
- {
- _popular = "asd"; // ошибка
- }
- }
- }
Решение задачи: «Как обратиться к переменной в get set»
textual
Листинг программы
- public getiset()
- {
- Popular = "asd";
- }
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д