title: Java ObjectOutputStream IOException
body: <p>I made a simple object that I'm trying to send though the OOS but everytime I try to send the class that I created it throws an IOException. But if I try to send objects through that I know are serializable it doesn't throw an error. </p>
  
  <pre><code>UserName userName = new UserName();
  _out.write("Object is Made! \n");
  serverOutput.writeObject(userName);
  serverOutput.flush();
  </code></pre>
  
  <p>Here's the Username Code:</p>
  
  <pre><code>public class UserName implements Serializable {
  
  private String _userName;
  
  public UserName(String userName) {
      _userName = userName;
  }
  
  public UserName(){
      _userName = "John Doe";
  }
  
  /**
   * @return the _userName
   */
  public String get_userName() {
      return _userName;
  }
  
  /**
   * @param _userName the _userName to set
   */
  public void set_userName(String userName) {
      _userName = userName;
  }
  
  }
  </code></pre>
  
  <p>If I do this then it doesn't throw the error:</p>
  
  <pre><code>UserName userName = new UserName();
  _out.write("Object is Made! \n");
  serverOutput.writeObject(new String());
  serverOutput.flush();
  </code></pre>
  
  <p>Do I actually have to implement any methods or am I forgetting something?</p>