instanceof operator
Summary
Check instanceof whether type transition is possible or not.
2. Type transition
3. instanceof parent returns true, but it does NOT mean fe is Object or Car!
4. Why doing reference type transition? By modifying reference type variable(remote control), able to control the number of usable members.
Check the type transition is possible. if it is possible, return true.
Before type transition, MUST check instanceof before type transition.
instanceof for parent and itself returns true.
FireEngine < Car < Object
fe instanceof Object/Car is true, but it does NOT mean fe is Object or Car. But it means type transition is possible.
Last updated