Pattern Matching in instanceof
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...
blog.commitbyte.com2 min read