public List<string> ListValue=new List<string> ();
Console.WriteLine( ListValue);
ListValue
List<string>
foreach(string s in ListValue) Console.WriteLine(s);
ing System; using System.Collections.Generic; namespace classSample { class Program { static void Main(string[] args) { ClassTwo cTwo = new ClassTwo(); List<string> theList = cTwo.GotThem; foreach (string item in theList) { Console.WriteLine(item); } Console.WriteLine("Hello World!"); Console.ReadKey(); } } public class ClassOne { public List<string> GetMe = new List<string>(); public ClassOne() { GetMe.Add("one"); GetMe.Add("two"); GetMe.Add("three"); } } public class ClassTwo { public List<string> GotThem { get; set; } public ClassTwo() { ClassOne cOne = new ClassOne(); GotThem = cOne.GetMe; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)