public static Object getCloneObject(Object bean) { Object cloneBean = null; try { ByteArrayOutputStream byout = new ByteArrayOutputStream(); ObjectOutputStream obj = new ObjectOutputStream(byout); obj.writeObject(bean); ByteArrayInputStream byin = new ByteArrayInputStream(byout .toByteArray()); ObjectInputStream ins = new ObjectInputStream(byin); cloneBean = (Object) ins.readObject(); } catch (Exception ex) { ex.printStackTrace(); } return cloneBean; }