Last post Sep 05, 2014 05:38 AM by shilpa.gururao
Sep 03, 2014 03:25 PM|gaddamraju4u|LINK
I am new to c#
can i create non static field in static method c# ?
can i create non static method in static class c# ?
can i create non static field and method in static main () method c# ?
static int a;
public static void test()
static int b=2;
int c=3; // can i create non static field in static method like this
thanks in advance
give me replay with short answer please
Sep 03, 2014 04:06 PM|AidyF|LINK
Why don't you try each thing and find out for yourself? It can't take more than a few minutes to test all of these. You can create non-static variables in static methods, not non static methods in a static class, you can create static variables inside
main but you can't create methods inside methods regardless of if things are static or not.
Sep 05, 2014 05:38 AM|shilpa.gururao|LINK
Understand Static concept. Static Class is "not instance specific". Instance specific variable are not acceptable.