Santanu Guha wrote:Can we create our own Marker Interface in Java ....? Is it possible ?
Sure. Just be sure to document
and publicise it well, because they're very easy to overlook. The number of custom Lists I've seen where the developer has forgotten to implement RandomAccess is a good case in point.
Another possibility to consider would be an interface with a single method (
isInterfaceName() ?) that returns a
boolean. That way the interface can't be ignored or forgotten, and it can be implemented without adding any extra fields.
Winston