ネイティブメソッド--Javaアレイマージ

直接コード(ツール)の騒ぎ、:

パブリック 静的オブジェクト[] combineArray(オブジェクト1 []、オブジェクト2は、[])は、スローBussinessException 
{ 
    オブジェクトのRESを[] = NULL ;
    もし(!1 = NULL && one.length> 0 &&(二== NULL || two.length == 0 ))
    { 
        RES = 新しいオブジェクト[one.length]。
        System.arraycopyの(1、 0、RES、0 、one.length)。
    } 
    もし、((1 == NULL || one.length == 0)&& 2!= NULL && two.length> 0 
    { 
        RES =新しいオブジェクト[two.length]。
        System.arraycopyの(2、 0、RES、0 、two.length)。
    } 
    もし(2!= NULL && 1 =!ヌル && two.length> 0 && one.length> 0 
    { 
        RES = 新しいオブジェクト[two.length + one.length]。
        System.arraycopyの(2、 0、RES、0 、two.length)。
        System.arraycopyの(1、 0 、RES、two.length、one.length)。
    } 
    戻りRES。
}

おすすめ

転載: www.cnblogs.com/javamjh/p/12177858.html