We can have an Array List with
Integers and a String in it. The technical term for this is "bad."
The ArrayList is not type-safe. Type safety enlists the compiler in
finding your bugs.
Stack
<int>
st = newStack<int>();
st.Push(1);
st.Push(2);
int
i =
st.Pop();
OR
class
Test<T>
{
public T F1(T i)
{
return
i;
}
}
Test
<int>
ob1 = newTest<int>();
Response.Write(ob1.F1(20));
Test<string> ob2 = newTest<string>();
Response.Write(ob2.F1("Amit"));