views:

80

answers:

1

Is there a way programmitcally to tell if a Java class is abstract? (Other than trying to instantiate and catching the error) Thanks!

+11  A: 

You can use reflection:

if (Modifier.isAbstract(FooBar.class.getModifiers())) {
    // ...
}
Chris Jester-Young