title: Deserialization from String in Java
body: <p>this is my first post here, but I'm really needing help on this one because I'm just starting to learn about Serialization/Deserialization in Java:</p>
  
  <p>I have a String that looks something like this:</p>
  
  <pre><code>String str = "ExampleClass[id=123,date=2009-07-12,state=OPEN]";
  </code></pre>
  
  <p>My question is: can I deserialize this so I can access the information inside this String?
  I've only seen examples where they use <code>ObjectOutputStream</code> and the method <code>.writeObject()</code> to first create a file and then later read from it. </p>
  
  <p>I also have a class that looks like this:</p>
  
  <pre><code>public class ExampleClass implements Serializable { 
      protected String id;
      protected Date startDate;
      protected String state;
  
      //other code...
  
      public String toString(){
          return "ExampleClass[id="+id+",date="+startDate+",status="state"]";
      }
  }
  </code></pre>
  
  <p>Maybe I haven't fully understood the concept of deserialization yet, but hopefully I could get an input here and find out if what I'm trying to do won't work or makes no sense.
  Thanks in advance!</p>