To limit the scope you d some sort of class annotation or class modifier and the virtual machine needed the functionality to check, whether a class (or any subclass of this restricted class) was assigned to a member or local variable and violated the constraint.
Just imagine, you had a class with the - just invented - onlylocal modifier, indicating that you only allow instances in local variables.
public onlylocal class LocalUseOnlyClass implements Serializable {
//...
}
and in another class someone just did in a constructor:
private Object member;
public MyOtherClass(Serializable something) {
this.member = something
}
The Compiler couldn t detect, if you passed an instance of LocalUseOnlyClass to that constructor, so the JVM had to check and throw an exception or an error.
BTW & OT: what s your intention? - maybe there s an alternative to fulfill your underlying requirement.