title: c# create class instance using method inside class
body: <p>I have a class called User, where one can initialize it like so:</p>
  
  <pre><code>User user = new User();
  </code></pre>
  
  <p>This works great, but in some cases I want to call a static method <em>inside</em> the User class, so that the code now looks like this:</p>
  
  <pre><code>User user = User.SomeMethod();
  </code></pre>
  
  <p>I am sure that it is not extremely difficult, because I have seen it done in <code>System.Diagnostics.Process</code>: </p>
  
  <pre><code>Process p = Process.Start("filename");
  </code></pre>
  
  <p>How can I make my class do the same?</p>
  
  <p>EDIT:</p>
  
  <p>This is what my class looks like:</p>
  
  <pre><code>public class User
      {
          public User()
          {
              // this runs when User u = new User() is called
          }
  
          public static void SomeMethod()
          {
              // I want this to run when "User u = User.SomeMethod() is called
          }
      }
  </code></pre>
  
  <p>Am I missing a method constructor?</p>