Answer: static is a keyword which can be used in many cases such as for
classes,
methods,
operators,
constructors etc.
static denotes the singular type and is used to declare a member or type.
static methods are very faster when compared with
instance methods as they doesn't comprises any instances.
By using static,
flexibility becomes less but
performance will be more.
static class MyClass // This is a static class
{
static int x; // This is a static variable
public static void Test() // This is a static method
{
.........;
........;
}
}
Asked In: Spotted While Learning |
Alert Moderator