# Serialization in P4

**URL:** <https://discourse.processing.org/t/serialization-in-p4/42420>\
**Category:** Beginners\
**Created:** [July 14, 2023, 12:51pm UTC](https://discourse.processing.org/t/serialization-in-p4/42420 "2023-07-14T12:51:56Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [July 14, 2023, 10:27pm UTC](https://discourse.processing.org/t/serialization-in-p4/42420/8 "2023-07-14T22:27:37Z")

</div>

> [@quark](#):
>
> When a class is defined inside the pde tab it becomes an `inner class` to the main sketch class (named after the sketch).

That’s what happened on this old issue:

> [@Deserializing objects sent from a client program to a server program](https://discourse.processing.org/t/deserializing-objects-sent-from-a-client-program-to-a-server-program/16124/9):
>
> Yes, your sketch works but because it is serializing and deserializing whithin the same scketch and thus class But what I’m having problems with is having 2 programs talking to each other (deserializing the data recived), the rest is good But when I try to deserialize java complains because the classes are different even tough they share the same source code I tried using .java files to make processing make the class without the .pde so it would give me ImagenSerializable and not NCliente$Im…

Solution is either declare class as `static` or place the class inside its own “.java” file tab:

> [@LinkedList vs ArrayList](https://discourse.processing.org/t/linkedlist-vs-arraylist/19946/14):
>
> Here’s a more streamlined FiFo Queue container I’ve come up w/ just now: innocent[Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/util/Queue.html](http://Docs.Oracle.com/en/java/javase/11/docs/api/java.base/java/util/Queue.html) /\*\* \* ArrayQueue (v1.1.1) \* GoToLoop (2020/Apr/20) \* https://Discourse.Processing.org/t/linkedlist-vs-arraylist/19946/14 \*/ //package java.util; // Uncomment this line if this is a ".java" file import java.util.Collection; import java.util.Queue; import java.util.List; import java.util.ArrayList; import java.util.Iterator; import ja…

> <https://gist.github.com/GoToLoop/145418d1dfb062c7c41a630bce5b8374>
>
> There are more than three files. show original

---

_[View the full topic](https://discourse.processing.org/t/serialization-in-p4/42420)._
