title: Initializing Objects to null or new?
body: <p>I'm developing a web app and a question arose when I receive parameters on server-side. I initialize my DTO's <em>(Data Transfer Object)</em> as local variables to <code>null</code> and when a specific parameter is passed, I initialize my object to <code>new</code>. An example to illustrate my code:</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      Object_DTO object_DTO = null;
  
      if(request.getParameter("parameter").equals("hello")) {
          object_DTO = new Object_DTO();
          object_DTO.setAttr("attr");
          ...
      }
  }
  </code></pre>
  
  <p>My question regarding performance is: what's the best way to initialize objects? Should I set it to <code>new</code> on declaration or keep the manner I'm doing?</p>