using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication13 { class Program { static void Main(string[] args) { arrayList mylist = new arrayList(4); mylist.addFirst('a'); mylist.addFirst('b'); mylist.addFirst('c'); mylist.addFirst('d'); try { mylist.addFirst('e'); } catch { } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; namespace ConsoleApplication13 { public arrayList(int v) { mylist = new char(v); size = 0; } public bool isEmpty() { bool rvalue = false; if (size == 0) ( rvalue = true; ) return rvalue; } public void addFirst(char c) { if (size == mylist.Length) throw new Exception } }
// required using System; using System.Collections; // somewhere in a method ... ArrayList aList = new ArrayList(); aList.AddRange(new string[] {"a","b","c","d","e"}); aList.Reverse();
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; namespace ConsoleApplication13 { public class arrayList { public arrayList(int v) { mylist = new char(v); size = 0; } public bool isEmpty() { bool rvalue = false; if (size == 0) ( rvalue = true; ) return rvalue; } public void addFirst(char c) { if (size == mylist.Length) throw new Exception } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)