Saving Serialized objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christo

    #1

    Saving Serialized objects

    ok i need serious help

    Im using this as a basic example

    lets say i have a class

    public class AddNum implements Serializable
    {
    public int mCount;

    AddNum()
    {
    mCount = 0;
    }

    public void Add()
    {
    mCount++;
    }
    }

    how can i save an object of this class utlizing serialization in the
    process?

    i have tried for almost a week now on my own and i am serously struggling

    any help would be great

    TIA

    Christo


  • Grzegorz Kaczor

    #2
    Re: Saving Serialized objects

    Christo wrote:[color=blue]
    > ok i need serious help
    >
    > Im using this as a basic example
    >
    > lets say i have a class
    >
    > public class AddNum implements Serializable
    > {
    > public int mCount;
    >
    > AddNum()
    > {
    > mCount = 0;
    > }
    >
    > public void Add()
    > {
    > mCount++;
    > }
    > }
    >
    > how can i save an object of this class utlizing serialization in the
    > process?
    >[/color]

    Use ObjectOutputStr eam.
    But please note one thing: If you have a network of objects, every one
    referencing some others, and you serialize all the network, every object
    will be saved only once in the stream. This can be sometimes annoying.

    Best Regards,
    Grzegorz Kaczor

    Comment

    Working...