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

Thread: Why POJO class implements Serializable Interface ?

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Why POJO class implements Serializable Interface ?

    Hi,
    I saw some websites in that have used pojo class

    but they have implemented the serializable interface.

    for eg .

    public class UsersPojo implements Serializable
    {
    //.... getter setter methods..
    }

    My question is why serializable is used in that case.

    Thanks in Advance
    Noorul


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Why POJO class implements Serializable Interface ?

    Its a way to tell the jvm that the class can be serialized using methods like writeObject().

    Read the API doc for the Serializable class and the class with the writeObject() method for more info.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. class,interface, or enum expected?
    By Eimaj in forum What's Wrong With My Code?
    Replies: 21
    Last Post: September 28th, 2012, 03:16 PM
  2. POJO Jenerator
    By JohnBoy in forum Web Frameworks
    Replies: 6
    Last Post: December 12th, 2010, 03:17 PM
  3. interface class ActionListener
    By NightFire91 in forum Java Theory & Questions
    Replies: 2
    Last Post: August 17th, 2010, 10:42 AM
  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
  5. Error of "class or interface expected" at Mylong class for problem of API's
    By lostgoat in forum What's Wrong With My Code?
    Replies: 3
    Last Post: July 22nd, 2009, 08:28 PM

Tags for this Thread