Java Marker Interface: Signaling Behaviour for JVM and Frameworks

A Java Marker Interface is an empty interface used to “mark” a class so that the JVM or frameworks can apply specific behaviour at runtime. Instead of defining methods, it acts as a signal for example, implementing "Serializable" tells the system that an object can be converted into a byte stream. In production systems, marker interfaces help frameworks detect capabilities of classes without tightly coupling logic to specific implementations. They often appear in discussions around serialisation, cloning, and framework behaviour. From an interview perspective, they are also useful when comparing older Java design patterns with modern alternatives such as annotations. In modern Java development, when would you prefer using a marker interface instead of annotations to indicate behaviour in a system? #Java #ObjectOrientedProgramming #BackendDevelopment #SoftwareEngineering #JavaDeveloper #InterviewPreparation

  • graphical user interface, application

To view or add a comment, sign in

Explore content categories