Arrays. Tasks

Author: Tatyana Milkina

1. One-Dimensional Array of Type String

  1. Create an array of type String with size 7.
  2. Assign it the values of the days of the week.
  3. Print the value of the last element to the console.

Get the full solution on Patreon.

2. One-Dimensional Array of Type double

  1. Create an array of type double with a size of 4.
  2. Initialize it with any values using an initializer block.
  3. Print the value of the first element to the console.

Get the full solution on Patreon.

3. Two-Dimensional Array of Type String

  1. Create a String array of size 3x6.
  2. Initialize it with the following values:
    a1 a2 a3 a4 a5 a6
    b1 b2 b3 b4 b5 b6
    c1 c2 c3 c4 c5 c6
  3. Print the array.

Full solution on Patreon.

4. Two-Dimensional Array of Type char

  1. Create a 2D array of type char with size 4x2.
  2. Initialize it using an initializer block.
  3. Print the array values.

Full solution on Patreon.

5. Find Max and Min Values in Each Row of a 2D Array

  1. Create a 5x8 integer array and initialize it using an initializer block.
  2. Find the maximum and minimum values in each row and store them in a 5x2 array.
  3. Print the new array containing the max and min values.

Solution on Patreon.

6. Garland Simulation Using Arrays

Implement the LED running light task (Java Operators Garlanda) using arrays. Use the System.arraycopy(...) method to simulate the scrolling effect.

Solution on Patreon.

Курс 'Java для начинающих' на Udemy Курс 'Java для начинающих' на Udemy
Read also:
Comments