This discussion is archived
2 Replies Latest reply: Sep 2, 2010 7:16 PM by 843790 RSS

Serializable a Marker Interface

843790 Newbie
Currently Being Moderated
hi

Serializable is a marker interface that means it has no methods or fields then how it work.

and while i coded some simple programs it gave similar result when i implemented serializable and also when i skipped it.
  • 1. Re: Serializable a Marker Interface
    EJP Guru
    Currently Being Moderated
    Serializable is a marker interface that means it has no methods or fields then how it work.
    Because the methods that rely on it test for its presence.
    and while i coded some simple programs it gave similar result when i implemented serializable and also when i skipped it.
    But not when you serialized something. That's what it's for.
  • 2. Re: Serializable a Marker Interface
    843790 Newbie
    Currently Being Moderated
    At first you should know what Serialization means:
    In computer science, in the context of data storage and transmission, serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be "resurrected" later in the same or another computer environment. (from Wikipedia).

    Objects of class which implement Serializable can be serialized. Thus, application will throw an Exception if you try to serialize an object of class that doesn't implement Serializable.