What are the advantages of non-static class over static class?
static class need not be instanciated. so we can directly use ClassName.MemberName, so then whats the use of nonstatic class
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A static class is basically the same as a non-static class, but there is one difference: a static class cannot be instantiated. In other words, you cannot use the new keyword to create a variable of the class type. Because there is no instance variable, you access the members of a static class by using the class name itself
A static class has only one instance of the class itself so you cannot create multiple instance of a static class.
looking at your question you cannot set two different values to the below property if the class is static because there will be only one instance of
ClassNamein memorymore info at
http://msdn.microsoft.com/en-us/library/79b3xss3.aspx