Why can't I create a private static const void?
We just moved from VB to C # and I was having trouble ..!
Why can't I create a private static void constant?
why is it not working?
private static const void MyVoid(void void)
{
try
{
this.void void = new void(void + void);
return this.void;
}
catch (void)
{
Response.Write(void);
}
}
-2
source to share
4 answers
void is a reserved keyword for "return nothing"
http://msdn.microsoft.com/en-us/library/yah0tteb.aspx
here is a list of all the reserved keywords http://msdn.microsoft.com/en-us/library/x53a06bb.aspx
think of Void as Sub for C #
In C # we only have methods - which return something (VB functions) or return nothing, i.e. void (VB Sub)
+1
littlegeek
source
to share