Pattern Matching in instanceof
Dec 1, 2021 · 2 min read · The traditional usage of instanceof operator requires typecasting inside the if block, i.e., if (obj instanceof String) { String s = (String) obj; ... } Though the block inside if gets executed only if obj X is a type of String object, the ja...
Join discussion



