25. [ ] Arrays C# Programming Fundamentals Objects Relationships Systems
26.
27.
28.
29.
30.
31.
32.
33.
34.
35. Array Notes int [ ] illegal[ , ]; class Base {...} class Derived : Base {...} Derived[] ds = new Derived[]{...}; Base[] bs = ds; unsafe { int * array = stackalloc int [42]; ... } only one syntax C# supports array covariance you can create an array on the stack, but only in unsafe code object o = new int [42]; arrays are reference types int [ ][ , ] mixed; you can mix the two kinds of arrays
136. Finally using System; using System.Reflection; public struct Finally : IDisposable { public Finally( object target, string methodName) { this .target = target; this .methodName = methodName; } public void Dispose() { Type t = target.GetType(); MethodInfo method = t.GetMethod(methodName); if (method != null ) { t.InvokeMember( methodName, BindingFlags.InvokeMethod, target, new object [0] ); } } private readonly object target; private readonly string methodName; }
137.
138.
139.
Notas del editor
ACCU Spring Conference, Christ Church College, Oxford, Friday 30 th March 2001. { JSL } Jagger Software Limited http://www.jaggersoft.com Tel . +44 (0) 1823 354 192 Hi, I'm Jon Jagger, a freelance software trainer, designer, and consultant. I specialise in curly bracket languages, hence { JSL }. In a former life I was QA Training's C++ and C product consultant. I'm an UK C++ standards panel member and a regular contributor to the ACCU Overload journal. I'm married with three increasingly larger children. My interests include training excellence, design, problem solving, and monty python (which should be required knowledge for all software developers). Forget the technical interview, just recite the parrot sketch. I don't really know what else to say in a short bio such as this. I'm very very good at sleeping. And breathing. Both of which I practice a lot.