title: How to make constructor that takes in 2 if there are 2 parameters, or 3 if there are 3
body: <p>New to Java...</p>
  
  <p>I have a name class that has:</p>
  
  <pre><code>private String firstName;
  private String middleInitial;
  private String lastName;
  </code></pre>
  
  <p>as its instance variables.</p>
  
  <p>If I had certain data that had only firstName and lastName, no middleInitial, how would I make the constructor so that it took only 2 parameters instead of three?</p>