Subscribe on YouTube

IB Computer Science | Year 2 (Senior) · 2D Arrays in Java · part 1/8

2D Arrays in Java: Rows & Columns

2D Arrays in Java: Rows & Columns

IB Computer Science B2.2, 2D arrays in Java: rows, columns and indexes (part 1 of 8, for SL and HL). What a 2D array is in Java, how to create one, and how to read and change one element. With a 5-mark exam question solved step by step.

In this lesson

  1. 0:00 Intro
  2. 0:17 Exam question
  3. 0:39 Warm-up
  4. 1:21 Rows and columns
  5. 2:28 Creating a 2D array
  6. 3:37 Read and change
  7. 4:22 Tracing practice
  8. 5:53 What earns the mark
  9. 6:26 Exam question solved
  10. 7:20 Recap
Answers to the practice questions at the end of the video
  1. double[][] temps = new double[7][24];
  2. 7 (1 + 6).
  3. m has only rows 0 and 1, so there is no row 2 [1]; the index is out of bounds and the program stops with a run-time error [1].

Questions are original, in the style of the exam; marks are estimates.

New IB lessons every day. Subscribe to TheIBAxolotl so the next part shows up in your feed.