CSharp Interview Question

Interview Part 1-Static class are almost same as default non-static class ,but there is difference:

Static
  1. Static class is defined using static keyword.                                                                      
  2. In static class, you are not allowed to create objects.                                                          
  3.  The data members of static class can be directly accessed by its class name.                                 
  4. A static class members are accessed by the class name followed by the member name.                                                                                                                                
  5. It is allowed to have only static members,                                                                             
  6. Static class cannot inherit from another class (it's sealed).                                                                     
  7. static classes are marked as sealed and abstract by compiler in the output MSIL.              
  8. A static constructor in a static class runs only once when any of its static members accessed for the first time.                                                                                                                          
  9. Static members are allocated in high frequency heap area of the memory.                               
  10. Static cannot be used with indexers, destructors or types other than classes.
Non-Static
  1. Non-Static class is not defined by using static keyword.                                                   
  2. In non-static class, you are allowed to create objects using new keyword.                     
  3. The data members of non-static class is not directly accessed by its class name.           
  4. Non-static class may contain both static and non-static methods.                                     
  5. Non-static class contains an instance constructor.                                                            
  6. Non-static class can be inherited from another class.

if you need more Static & Non-Static