Question: I am using an arrayList in one of my code. I am finding it difficult to retrieve elements out of an arraylist. it gives me an error when i use this: 

`getit = newlist.get(g);`

Basically I want the string variable `getit` to store the value of the gth element of the arraylist called 'newlist' and then use it.

Could someone help with this? I am using Processing language for this.

All help will be appreciated,

Thanks in advance,

Amrita

Answer: 
There is one more way: T4 Templates.
See here: <http://msdn.microsoft.com/en-us/data/gg558520>

The resulting CS file is generated at build time. This means you could potentially loop your classes using refelection and the result would be what you have now manually created in your "SuperClass".

The cool thing really is that the resulting code is generated on the fly and it is typesafe.

Is it worth the effort? I don't know. It really depends what you are doing and why you are doing it.

We use it for instance to translate `Func<T1, T2>` into "real" delegates and auto-generate wrapper classes that way.
You cannot do this easily in C#. You could inherit from one of the classes, and create delegates for the other, or you can manually create delegates for both (by delegate, I just mean a method that delegates to the member object, not anything to do with the `delegate` keyword or class).

If you use a product such a Resharper, there is an option in the Refactor menu that will automate this process, called "Create delegates..."