D
Danny Tuppeny
Hi all,
Any ideas why the below code won't throw an exception? It appears that the
base Add method is being called, and not mine :-(
-- Console App --
using System;
using System.Collections.Generic;
using System.Text;
namespace RelationshipListTest
{
class Program
{
static void Main(string[] args)
{
ListTest<int> myList = new ListTest<int>();
myList.Add(1);
}
}
public class ListTest<T> : List<T>
{
new void Add(T item)
{
throw new NotImplementedException();
}
}
}
Any ideas why the below code won't throw an exception? It appears that the
base Add method is being called, and not mine :-(
-- Console App --
using System;
using System.Collections.Generic;
using System.Text;
namespace RelationshipListTest
{
class Program
{
static void Main(string[] args)
{
ListTest<int> myList = new ListTest<int>();
myList.Add(1);
}
}
public class ListTest<T> : List<T>
{
new void Add(T item)
{
throw new NotImplementedException();
}
}
}