Reporting multidimensional Array Java oop

Jassykasoho 6 views 9 slides Sep 15, 2024
Slide 1
Slide 1 of 9
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9

About This Presentation

kendengjkendeng


Slide Content

INTRODUCTION
TO
MULTI-DIMENSIONAL
ARRAY
2 - Dimensional Array

Objectives:
Description of 2-D Array;
Creating a 2-D Array, and;
Calling/Displaying 2-D Array.

1-D Array
int Arr[5];

1-D Array
int Arr[5];
2-D Array
int Arr[2][5];

2-D Array
int Arr[2][5];
Data values/
elements

Syntax
dataType[][] arrayName;
arrayName = new dataType[rows][column];
dataType[][] arrayName = new dataType[rows][column];
or
index

Initialize
Data type = int Array name = Arr Row = 2 Column = 3
int[][] Arr = new int[2][3];
Data type
Empty brackets
Array name
Keyword “new”
Data type
Rows Columns
Index

int[][] Arr = new int[2][3];
int[][] Arr = {{1, 2, 3}, {4, 5, 6}};
or

int[][] Arr = {{1, 2, 3}, {4, 5, 6}};
int[][] Arr = {{1, 2, 3}, {4, 5, 6}};
Rows = 2
Columns = 3
1 2 3
4 5 6
0
1
0 1 2
Tags