Использование свойств - C#
Формулировка задачи:
Подскажите, как можно с помощью свойств установить длину массива из Programm.cs в Class.cs
Решение задачи: «Использование свойств»
textual
Листинг программы
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Class1
{
public int[] arr;
// int length;
public int Length
{
get
{
return arr.Length;
}
set
{
arr = new int[value];
// length = value;
}
}
}
}