title: Make JSONObject subclass serializable
body: <p>I have a class with JSONObject as property and I want to make it serializable so I create an additional class MyJSONObject like this:</p>
  <pre><code>public class MyJSONObject extends JSONObject implements Serializable {
      public MyJSONObject() {
          super();
      }
  
      public MyJSONObject(String json) {
          super(json);
      }
  
      public MyJSONObject put(String key, Object value) {
          return (MyJSONObject) super.put(key, value);
      }
  
      public Object get(String key) {
          return super.get(key);
      }
  
      public String toString() {
          return super.toString();
      }
  }
  </code></pre>
  <p>I use ObjectOutputStream.writeObject() to send it from client to server but when I receive it on the server, the JSONObject is null. What problem is it? And how can I make it correct?
  I know there is a question about this but most of the answer is using toString() and I want to try this way so I ask this question.</p>