In .NET, one can specify a \"mustoverride\" attribute to a method in a particular superclass to ensure that subclasses override that particular method. I was wondering whether
... and if declaring a base class abstract is not an option you can always throw an UnsupportedOperationException
abstract
class BaseClass { void mustOverride() { throw new UnsupportedOperationException("Must implement"); } }
But this is not a compile-time check of course...