Java tutorial
//package com.java2s; public class Main { public static boolean isSameType(Object array1, Object array2) { if ((array1 == null) || (array2 == null)) { throw new IllegalArgumentException("The Array must not be null"); } return array1.getClass().getName().equals(array2.getClass().getName()); } }