public interface MyMarkerInterface {}
public class MyMarkedClass implements MyMarkerInterface {}
Then you can, for example, have a method that accepts only an instance MyMarkerInterface:
public myMethod(MyMarkerInterface x) {}
or check the box instanceofat runtime.
source
share