52 Question Quiz Corrections

What I got wrong

  • toc:true - badges: true
  • comments: true
  • categories: [jupyter]
  • image:

Quiz Score

51/52

Incorrect Question...

Question 1

  • Question: Consider the following code segment.
int[][] anArray = new int[10][8];

 

for (int j = 0; j < 8; j++)

{

for (int k = 0; k < 10; k++)

{

anArray[j][k] = 5;

}

}
  • The code segment causes an ArrayIndexOutOfBoundsException to be thrown. How many elements in anArray will be set to 5 before the exception is thrown?
  • Correct Answer: 8
  • Explanation: I just counted wrong...I included the last value in the column when in reality the function would have stopped there

General Reflections on Test

  • Took me too long to complete the quiz, should have been able to finish it faster.