xterm wroteSyntactically it's correct, practically it works. Theoretically it's incorrect, proper OO dictates that a much better solution would be to apply further constraints to achieve such functionality in a better hierarchical structure with additional Behavior.
yes, theoretically its incorrect, like its always better to use information supported by the class itself, but i'm just kinda explaining some point of using that operator.
The case is similar with Threads, you an use the Thread.stop() method, but it's being deprecated, because it might cause some synch problems and theoretically incorrect, therefore it always recommended to base what's in the run() method on conditions, where certain stuff won't execute if for example a certain boolean , integer or whatever's value changes.