javamjh

废话不多说,直接上代码(工具类):

public static Object[] combineArray(Object one[], Object two[]) throws BussinessException
{
    Object res[] = null;
    if(one != null && one.length > 0 && (two == null || two.length == 0))
    {
        res = new Object[one.length];
        System.arraycopy(one, 0, res, 0, one.length);
    }
    if((one == null || one.length == 0) && two != null && two.length > 0)
    {
        res = new Object[two.length];
        System.arraycopy(two, 0, res, 0, two.length);
    }
    if(two != null && one != null && two.length > 0 && one.length > 0)
    {
        res = new Object[two.length + one.length];
        System.arraycopy(two, 0, res, 0, two.length);
        System.arraycopy(one, 0, res, two.length, one.length);
    }
    return res;
}

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-25
  • 2022-01-24
  • 2022-01-30
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案