Say I have a list of Objects (Shape), but I only want to operate on one specific subclass of said Object (2DShape)
I could say
if (!(value instanceof 2DShape)) continue;
Previously I might’ve done INCREDIBLY horrific stuff involving incrementing ‘i’ an extra time lol
Say I have a list of Objects (Shape), but I only want to operate on one specific subclass of said Object (2DShape)
I could say
if (!(value instanceof 2DShape)) continue;
Previously I might’ve done INCREDIBLY horrific stuff involving incrementing ‘i’ an extra time lol