I have defined a delegate field inside a class and I am initializing that delegate field directly inside a static function (without making an object). It should not work, because there is no object of the class and the delegate field is not static. But it works. Can anyone please explain how it works. I have copied some of my code below for reference:
class Test
{
delegate void CustomDel(String s);
static void main()
{
CustomDel del1, del2, del3; //it shouldn't work, but is working.
}
}