First, let's see an example of a non-generic type, so that you can understand the problem that generics is designed to solve.
In the PacktLibrary project, add a new class named Thing, as shown in the following code, and note the following:
- Thing has a field named Data of the object type
- Thing has a method named Process that accepts an input parameter of the string type, and returns a string value
If we wanted the Thing type to be flexible in .NET Framework 1.0, we would have to use the object type for the field.
using System;namespace Packt.CS7{ public class Thing { public object Data = default(object); public string Process(string input) { if (Data == input) { return Data.ToString() + Data.ToString(); } else {