c# - When I type static, Visual Studio replaces it with ContextStaticAttribute -
every time i'd put in static
keep replacing contextstaticattribute
.
i need 10 rep post images, here's link: http://i.imgur.com/jboof3s.png)
i not want have press right arrow put in local variable!
i figured out how did typing static
inside method.
variables in method cannot static, class level elements can.
simply declare variables inside class, not method.
example:
namespace consoleapplication2 { class program { static string username; // correct private static void main() { static // incorrect } } }
Comments
Post a Comment