Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- namespace CsharpStudy
- {
- /*
- * [ ArrayList ]
- * - Definition
- * - Boxing , UnBoxing
- */
- internal class Program
- {
- static void Main(string[] args)
- {
- ArrayList list = new ArrayList();
- list.Add(1);
- list.Add("string");
- list.Add(true);
- list.AddRange(new int[] { 1, 2, 3 });
- list.Remove(1);
- // list.RemoveAt(1);
- // list.RemoveRange(1, 2);
- foreach(object o in list) {
- Console.WriteLine(o);
- }
- int x = 1;
- #region boxing / unboxing
- // boxing
- object o = x;
- //int y = o; xxx
- // unboxing
- int y = (int)o;
- #endregion
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement