Figuring out whether a number is a Double in Java January 15, 2023 by Tarik Try this: if (items.elementAt(1) instanceof Double) { sum.add( i, items.elementAt(1)); }