Skip to content

Advanced Java · Week 1

2D Arrays

Step 1 of 6

Java 2 Guided Tutorials - Week 1: 2D Arrays

What You'll Learn

Welcome to Week 1 of Java 2! This week, we'll dive into the world of 2D arrays. We'll start with a quick review of 1D arrays from Java 1, then move on to understanding and working with 2D arrays.

Lesson Overview:

  • Review of 1D arrays from Java 1
  • Introduction to 2D arrays
  • Declaring and initializing 2D arrays
  • Accessing and modifying elements in 2D arrays
  • Common operations with 2D arrays
  • Quiz to test your knowledge
  • Weekly project to apply what you've learned

By the end of this week, you'll have a solid understanding of 2D arrays and be able to use them in your Java programs. Let's get started!

Quick check

  1. 1. How do you declare a 2D array of integers with 3 rows and 4 columns?

  2. 2. What does the following code print? int[][] arr = {{1, 2}, {3, 4}, {5, 6}}; System.out.println(arr[1][1]);

  3. 3. How many elements are in the following 2D array? int[][] matrix = new int[3][4];