When do we use static in c#?
I'm reading a book and i see this
orCode:static int val;
But why do you use static en why don't you just write for exampleCode:static void ShowDouble(){ ... }int val;?
When do we use static in c#?
I'm reading a book and i see this
orCode:static int val;
But why do you use static en why don't you just write for exampleCode:static void ShowDouble(){ ... }int val;?
From: http://msdn.microsoft.com/en-us/libr...8VS.71%29.aspxUse the static modifier to declare a static member, which belongs to the type itself rather than to a specific object. The static modifier can be used with fields, methods, properties, operators, events and constructors, but cannot be used with indexers, destructors, or types.
{CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
Follow Me on Twitter: @InkingHubris
PHP Code:$result = mysql_query("SELECT finger FROM hand WHERE id=3");
echo $result;
I found the same yesterday, but can someone explain it with his own words?
edit:
Found more information on this site:
http://www.daniweb.com/forums/thread96978.html#
Last edited by NDK; 04-28-2010 at 12:29 PM. Reason: found more info on site
Bookmarks