That's very simple, just define an interface without any methods:
You could then write classes that implement the interface. If you want to see if an object is of a type that implements the marker interface, you can use the instanceof operator to check that.
Note that since Java 5, annotations have mostly superseded marker interfaces. You'd probably want to write your own annotation instead of a marker interface if you're using Java 5 or newer.