bool nameOfPredicate(T object) Array.Find(myArrayOfStuff, myPredicateMethod); public bool myPredicateMethod(Slacker alpha) { return (alpha.Points > 42); } public Slacker[] everyInstanceOf(int alpha) { List pool = new List(); foreach (Slacker i in myCollectionOfSlackers) { if (i.Points > 42) pool.Add(i); } return pool.ToArray(); } SortedDictionary pool = new SortedDictionary(); foreach (var i in pool) foreach (object i in pool) foreach (KeyValuePair i in pool) { Console.WriteLine(i.Key + " " + i.Value); } try { alpha = 42 / 0; } catch (DivideByZeroException e) { Console.WriteLine("You can't divide by zero, you dummy."); } catch (Exception e) { Console.WriteLine("You can't do this: " + e.ToString()); } finally { // This is code that's executed no matter what // Exception, no exception -- this stuff happens } public class MyNewException : Exception // This is the base Exception class { public override string ToString() { return "This is my special exception message."; } } // Somewhere else in my program public void foo() { if (alpha.Points == -1) throw MyNewException(); // we're doing this // as opposed to doing this { Console.WriteLine("You can't do this!!"); badFlag = true; } } public static void Main(string[] args) { try { foo(); } catch (MyNewException e) { // print whatever message is appropriate } catch (Exception e) { // for anything else that goes wrong } } public class Slacker : IComparable, IEnumerable { // private attributes // public properties // constructor(s) public int CompareTo(Object alpha) { // this is where you define the rules of comparison } public IEnumerator.Enumerator (CommentEnum alpha) { return alpha; } public CommentEnum (Comment[] arrayOfComments) { return CommentEnum(arrayOfComments); } // ToString } public class CommentEnum : IEnumerator? { } // public DateTime dt; public Post(string[] args) { // assign ID, content, title, authorId, etc. dt = new DateTime(Convert.ToInt32(args[6]), [7], [8], [9], [10], [11]) Console.WriteLine(dt.ToString()); } List comments; // This is essentially a dynamically allocated array comments = new List(); LinkedList comments; // This is a doubly-linked list of Comment Nodes comments.Add(newComment); comments.Remove/Erase(badComment); SortedSet SortedDictionary TKey TValue comments.