Click here to Skip to main content
16,023,339 members

Comments by GD6882 (Top 3 by date)

GD6882 30-Aug-10 17:13pm View    
Nothing just stumbled accross this case.
Try this null is an reserved Keyword. I tried it as @null=-1, and it allowed me to declare it.
Funny :)
GD6882 30-Aug-10 17:11pm View    
Thanks,
But @null=-1 is accepted. Why so since null as identifier is not allowed as it is resevered keyword.
GD6882 30-Aug-10 16:35pm View    
class Program {
        enum Fruits {
            @apple = -1,
            Apple = 1,
            Grapes = 2,
            Orange = 3 };
        static void getfruit(Fruits f) {
            Console.WriteLine(f); } static void getfruit(Nullable<Fruits> f = Fruits.@apple) 
{ try 
{ 
Console.WriteLine(f); 
} 
catch 
{ Console.WriteLine("Null"); } } 
static void Main(string[] args) 
{ getfruit(Fruits.Apple); 
getfruit(); 
Console.Read(); } }

Try this