자바 int 형식 배열 요소 복사 실현

//   :  int        


class ArrayElementCopy
{
    public static void main(String[] args)
    {
        int[] src = new int[]{1,2,3,4,5,6,7,8,9,10};
        int[] dest = new int[]{10,0,0,0,0,0,0,0,0,0};

        //  : src     3,4,5,6   dest   
        printArray(dest);
        copy(src,2,4,dest,3); //         
        printArray(dest);
    }

    /*
          :
            src:    
            srcPos:                 
            number:        
            dest:    
            destPost:       
    */
    static void copy(int[] src, int srcPos, int number, int[] dest, int destPos)
    {
        int srcStartPos = srcPos;
        int srcEndPos = srcStartPos + number;

        for(int i=srcStartPos; i 
  


좋은 웹페이지 즐겨찾기