title: Define an instance of a class but instead of passing parameters into the constructor pass only the fields you want to define after it
body: <p>I have seen this work in C# and wanted to ask if there is a way of doing this in Java as well?
  if lets say we have a class student:</p>
  <pre><code>public class Student {
  
  private long id;
  private String fName;
  private String mName;
  private String lName;
  
  public Student();
  </code></pre>
  <p>}</p>
  <p>In c# if we wanted to instantiate that class you would be able to do the following:</p>
  <pre><code>Student student = new Student(){ 
  id = 1,
  fName = &quot;Alex&quot;, 
  lName = &quot;Joe&quot; };
  </code></pre>
  <p>and an instance of a student would be created with only id fName and lName filled out and mName would be null. Is there any such option in Java that would work accordingly?</p>