10 Replies Latest reply: Nov 19, 2008 8:21 AM by thomas.behr RSS

    serialization

    807589
      isi t possible to serialize the object with out implementing the serializable interface in java?
        • 1. Re: serialization
          800282
          Venkat.Peddi wrote:
          isi t possible to serialize the object with out implementing the serializable interface in java?
          No.
          • 2. Re: serialization
            thomas.behr
            Venkat.Peddi wrote:
            isi t possible to serialize the object with out implementing the serializable interface in java?
            Yes.
            • 3. Re: serialization
              799716
              thomas.behr wrote:
              Venkat.Peddi wrote:
              isi t possible to serialize the object with out implementing the serializable interface in java?
              Yes.
              [How?|http://en.wikipedia.org/wiki/Serialize]
              • 4. Re: serialization
                807589
                can i have the code snippet please and which JDK it will support?
                • 5. Re: serialization
                  thomas.behr
                  Just in case you are confused now (and I hope you are), your question does contain too little information to provide a definite answer.

                  What kind of objects do you want to serialize? In which way do you want to serialize these object?
                  • 6. Re: serialization
                    800282
                    phdk wrote:
                    thomas.behr wrote:
                    Venkat.Peddi wrote:
                    isi t possible to serialize the object with out implementing the serializable interface in java?
                    Yes.
                    How?
                    Probably by implementing the CeciNestPasSerializable interface instead.
                    interface CeciNestPasSerializable extends java.io.Serializable { }
                    Or by serializing the attributes of the class and upon reading them from disc, creating a new instance of the class.
                    • 7. Re: serialization
                      thomas.behr
                      phdk wrote:
                      thomas.behr wrote:
                      Venkat.Peddi wrote:
                      isi t possible to serialize the object with out implementing the serializable interface in java?
                      Yes.
                      How?
                      Serialization is the process of converting an object into a sequence of bits so that it can be stored on a storage medium. How that is done, is up to the programmer. Serializable just marks a class as serializable via ObjectInputStream/ObjectOutputStream. Other ways are possible, e.g. serializing beans via XMLEncoder/XMLDecoder.
                      • 8. Re: serialization
                        799716
                        prometheuzz wrote:
                        Probably by implementing the CeciNestPasSerializable interface instead.
                        I just love that one. Or simply supergluing the object to the floor!
                        • 9. Re: serialization
                          thomas.behr
                          Venkat.Peddi wrote:
                          can i have the code snippet please and which JDK it will support?
                          Huh? Which code snippet? How you serialize an object is up to you. Of course you need to know which information encapsulated in the object needs to be considered in the serialization process. There is no universal way if you do not go with implementing Serializable.
                          • 10. Re: serialization
                            thomas.behr
                            phdk wrote:
                            prometheuzz wrote:
                            Probably by implementing the CeciNestPasSerializable interface instead.
                            I just love that one. Or simply supergluing the object to the floor!
                            Wow, phdk, what a lousy joke.