Skip to main content

Bar instanceof @Foo

No replies
regexguy
Offline
Joined: 2003-06-20

I wonder if instanceof should be able to check for runtime properties of classes.

public @interface Foo {}

@Foo public class Bar { ... }

Bar b = new Bar();
if(b instanceof @Foo) {
System.out.println("It's a Foo!");
}