Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Java Serialization question

  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Java Serialization question

    I have a class
    Employee{
    int sal;
    String name;
    String role;
    }

    I have to serialize the object, but doesn't want to serialize the variable "role". I don't want to declare the variable as transient.
    Does anyone how to do it?


  2. #2
    Member
    Join Date
    Dec 2011
    Location
    United States
    Posts
    94
    My Mood
    Amused
    Thanks
    5
    Thanked 8 Times in 8 Posts

    Default Re: Java Serialization question

    Roll out your own Serializer and define SerialPersistentFields ...... Good luck and you can read more at
    Java Beginner Tutorial

  3. #3
    Member
    Join Date
    Mar 2011
    Posts
    114
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Re: Java Serialization question

    Thanks Elisha for directing me to rite path

  4. #4
    Member
    Join Date
    Dec 2011
    Location
    United States
    Posts
    94
    My Mood
    Amused
    Thanks
    5
    Thanked 8 Times in 8 Posts

    Default Re: Java Serialization question

    Quote Originally Posted by tcstcs View Post
    Thanks Elisha for directing me to rite path
    You probably know something about making variables static or transient - besides creating your own! I really do not know why you cannot use transient because I thought they created that for that purpose! Wish you good luck still!

Similar Threads

  1. Serialization of lists
    By colerelm in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 5th, 2011, 09:39 PM
  2. DefaultTableModel Serialization
    By newbie in forum Java Theory & Questions
    Replies: 8
    Last Post: August 15th, 2011, 07:46 PM
  3. Sub class Serialization
    By Param in forum Java Theory & Questions
    Replies: 6
    Last Post: April 23rd, 2010, 02:04 AM
  4. Exception and Serialization Problems
    By chrisych in forum Exceptions
    Replies: 0
    Last Post: February 7th, 2010, 10:30 AM
  5. serialization problem
    By Park in forum Object Oriented Programming
    Replies: 2
    Last Post: November 26th, 2009, 03:44 PM