Women in Technology

Hear us Roar



Article:
  Making Java Objects Comparable
Subject:   instanceof check is unnecessary
Date:   2003-03-21 12:47:07
From:   anonymous2
A ClassCastException will automatically be thrown if you attempt (A) b when !(b instanceof A). The check is redundant.