code_junkie

Should we use Generic Collection to improve safety and performance?

Nov 12th, 2011
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. ArrayList list = new ArrayList();
  2. list.Add(5);
  3. list.Add("FooBar");
  4.  
  5. List<int> list = new List();
  6. list.Add(5);
  7. // Compile Time Error.
  8. list.Add("FooBar")
Add Comment
Please, Sign In to add comment