title: Static Class vs Protected Constructor
body: <p>I Am getting a warning message in my class, like</p>
  <p><a href="https://i.stack.imgur.com/uXCBm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uXCBm.jpg" alt="enter image description here" /></a></p>
  <blockquote>
  <p><em>Add a <code>Protected</code> constructor or the <code>static</code> keyword to the class declaration</em></p>
  </blockquote>
  <h2>Solution</h2>
  <p>The error is gone after I tried both the below ways,</p>
  <h2><code>static</code> class without <code>constructor</code></h2>
  <pre><code>public static class Program    {
      }
  </code></pre>
  <h2>Non <code>static</code> class with <code>protected</code> using constructor</h2>
  <pre><code>public  class Program
      {
          protected Program() { }
      }
  </code></pre>
  <h2>Question:</h2>
  <p>So What is the difference between Static Class vs Protected Constructor which is mentioned in my above solution? And which one is best to use?</p>