편집 기록

편집 기록
  • 프로필 편집요청빌런님의 편집
    날짜2020.01.14

    Index 5 out of bounds for length 5 오류 질문


    static String lookCard(int[] myCard)
        {
            int temp;
    
            for(int i = 0; i < myCard.length; i++)
            {
                for(int j = 0; j < myCard.length; j++)
                {
                    if(myCard[i] < myCard[j])
                    {
                        temp = myCard[i];
                        myCard[i] = myCard[j];
                        myCard[j] = temp;
                    }
                }
            }
        }
    

    현재 이 함수에서

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5
    

    오류가 발생합니다. 아무리 봐도 잘못된점을 찾지 못하겠습니다..

  • 프로필 nowp님의 편집
    날짜2020.01.14

    Index 5 out of bounds for length 5 오류 질문


    static String lookCard(int[] myCard)
        {
            int temp;
    
            for(int i = 0; i < myCard.length; i++)
            {
                for(int j = 0; j < myCard.length; j++)
                {
                    if(myCard[i] < myCard[j])
                    {
                        temp = myCard[i];
                        myCard[i] = myCard[j];
                        myCard[j] = temp;
                    }
                }
            }
        }
    

    현재 이 함수에서

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5

    오류가 발생합니다. 아무리 봐도 잘못된점을 찾지 못하겠습니다..

  • 프로필 황병준님의 편집
    날짜2020.01.14

    Index 5 out of bounds for length 5 오류 질문


    static String lookCard(int[] myCard) { int temp;

        for(int i = 0; i < myCard.length; i++)
        {
            for(int j = 0; j < myCard.length; j++)
            {
                if(myCard[i] < myCard[j])
                {
                    temp = myCard[i];
                    myCard[i] = myCard[j];
                    myCard[j] = temp;
                }
            }
        }
    }
    

    현재 이 함수에서

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5

    오류가 발생합니다. 아무리 봐도 잘못된점을 찾지 못하겠습니다..