ElvisUntot wrote:
i think i got a few steps further, i can serialize objects, but i can not cast an class into an object....
Your problem is that you are trying to put the results of a call to main(String[]) (an incorrect call btw) into an Object. main(String[]) returns void, this means that the results can never be stored in an Object. Serialization has nothing to do with methods. Serialization is strictly a way of persisting the state of objects. A method is not an object, it is merely an operation that can be performed on objects. It makes no sense to try and serialize a method.