On Jan 21, 8:01 pm, [email protected] wrote:
> Here are my class:
>
> public class MyClassToBePersisted implements Serializable {
>
>     String profile, school;
>     transient private int yearStarted;
>
>     public void Profile(String name, int age, String hobby) {
>         profile = name + " " + age + " " + hobby;
>     }
>
>     public void School(String nameOfSchool, int yearStarted) {
>         this.yearStarted = yearStarted;
>         school = nameOfSchool + " " + yearStarted;
>     }
>
>     public String getProfile() {
>         return profile + school;
>     }
>
> }
>
...

You should have Profile and School attributes inside your class, and
build Profile and School inside the constructor.
Then you'll have the necessary print functions to display Profile and
School attributes

In your others classes, you serialize and deserialize the whole object
and use lookup (ObjectStreamClass) to deserialize it.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to