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 3 of 3

Thread: Serializable interface

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Serializable interface

    Query-2 : Your base class implements Serializable interface. In a happy go scenario both the base class and subclass objects will get serialized. Now I want that subclass object/properties doesn't get serialized.
    a) I can use transient keyword in front of the properties. However what if we have 100 of properties ? How we can make sure that subclass object doesn't get serialized if base class implements Serializable interface ?


  2. #2
    Junior Member
    Join Date
    Feb 2014
    Location
    gurgaon
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Serializable interface

    Writing an object of base class should do the needful..

  3. #3
    Junior Member
    Join Date
    Jun 2014
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Serializable interface

    Quote Originally Posted by payalBansal View Post
    Writing an object of base class should do the needful..
    However payal inheritance is basically the reference of the base class and object of the subclass. If i will write the object of base class only then it will behave as a simple class.

    Still I would be obliged with you or somebody could submit the working code snippet also

Similar Threads

  1. Serializable arraylist as txt?
    By klskl in forum File I/O & Other I/O Streams
    Replies: 8
    Last Post: November 11th, 2013, 12:10 PM
  2. Why POJO class implements Serializable Interface ?
    By noorul11 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 28th, 2013, 06:34 AM
  3. Serializable compiler warning
    By kc120us in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: September 25th, 2011, 04:12 PM
  4. what is the use of transient class and serializable interface?
    By chinni in forum Object Oriented Programming
    Replies: 3
    Last Post: October 28th, 2009, 05:48 PM