title: How can I create a User class and register new users?
body: <p>I'm trying to create a class called User that can register new Users and store them in a list. Currently, I just want to be able to use the RegisterUser object. I have a C# book and have tried understanding it, but it's not clicking. Any help or hints in the right direction are very much appreciated.</p>
  <pre><code>namespace UserClass {
  
      /// &lt;summary&gt;
      /// The user class
      /// &lt;summary&gt;
  
      public class User {
          public string userName;
          public string password;
          public string address;
          public int contactNumber;
  
  
          public static RegisterUser(string username, string pass, string add, int contact) {
              User newUser = new User();
  
              newUser.userName = username;
              newUser.password = pass;
              newUser.address = add;
              newUser.contactNumber = contact;
  
              WriteLine(newUser);
          };
  
      }
  }
  </code></pre>