Type Inquiry
- Test whether e is a Shape:
if (e instanceof Shape) . . .
- Common before casts:
Shape s = (Shape) e;
- Don't know exact type of e
- Could be any class implementing Shape
- If e is null, test returns false (no
exception)
previous |
start |
next .... [Slide 9] ....