1

What is use of user defined marker interface, and how it works? In case of already defined marker interfaces such as serializable or cloneable, the JVM do some internal processing, but for the user defined marker interface how JVM behave?

narendrak
  • 51
  • 1
  • 3

1 Answers1

2

The Marker Interface pattern is a well known pattern that allows you to indicate something about a type without implementing any behaviour. Wikipedia does a better write-up that I can summarize so you should read that.

To answer your question directly, the JVM won't treat your type any different. It will be a type that implements an interface and that is it.

Kevin Boyle
  • 457
  • 2
  • 7