title: Class.newInstance breaks compile-time exception checking
body: <p>The following text is from "Effective Java", Item 2:</p>
  
  <blockquote>
    <p>The traditional Abstract Factory implementation in Java has been the 
    <code>Class</code> object, with the <code>newInstance</code> method playing the part of the 
    build method. This usage is fraught with problems. The <code>newInstance</code> 
    method always attempts to invoke the class’s parameterless 
    constructor, which may not even exist. You don’t get a compile-time 
    error if the class has no accessible parameterless constructor. 
    Instead, the client code must cope with <code>InstantiationException</code> or 
    <code>IllegalAccessException</code> at runtime, which is ugly and inconvenient. 
    Also, the <code>newInstance</code> method propagates any exceptions thrown by the 
    parameterless constructor, even though <code>newInstance</code> lacks the 
    corresponding <code>throws</code> clauses. In other words, <code>Class.newInstance</code> breaks
    compile-time exception checking. The Builder interface, shown above, 
    corrects these deficiencies.</p>
  </blockquote>
  
  <p>Please go to <a href="https://gist.github.com/kpgalligan/143fd33011c402c38e95" rel="nofollow noreferrer">this link</a> for full text.</p>
  
  <p>I've been able to follow everything before, "In other words..". Can someone please explain how does <code>newInstance</code> break compile-time exception checking and how does Builder pattern fixes it.</p>