title: Make immutable Java object
body: <p>My goal is to make a Java object immutable. I have a class <code>Student</code>. I coded it in the following way to achieve immutability:</p>
  
  <pre><code>public final class Student {
  
  private String name;
  private String age;
  
  public Student(String name, String age) {
      this.name = name;
      this.age = age;
  }
  
  public String getName() {
      return name;
  }
  
  public String getAge() {
      return age;
  }
  
  }
  </code></pre>
  
  <p>My question is, what is the best way to achieve immutability for the <code>Student</code> class? </p>