posted 18 years ago
You can say
someObject.getClass().isInstance( x )
when you don't know what class someObject is at compile time. You must know what class you're comparing at compile time when you say
x instanceOf SomeHardCodedClass
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi