Sunday, 28 April 2024

Static class benfits

 

 Key Points to Remember for a Technical Interview

  1. Static classes cannot be instantiated or extended.
  2. A static class can only contain static members.
  3. Static members are accessed via the class name, not an instance of the class.
  4. Static classes are sealed and therefore cannot be inherited.
  5. Static constructors are called automatically when a static member is referenced.
  6. Static members are initialized only once, at the class loading.
  7. The 'this' keyword is not available in static methods since they belong to the class, not an instance of the class.

No comments:

Post a Comment

remove duplicates in an sorted array

  using System; public class HelloWorld {          public static void Main(string[] args)     {         int[] ar={2,2,3,3,4,6,6};          C...