Слайд 2Agenda
02
03
04
Arrays Initializers and Anonymous Arrays
“for each” loop
Array Copying
Array Sorting
01
05
Multidimensional Array
06
Ragged Array
Слайд 3Array copying
02
int[] smallPrimes = {2, 3, 5, 7} ;
new int[] {17, 19,
Слайд 4“for each” loop
for (variable : collection) statement
for(int el : smallPrimes) System.out.println(el);
Слайд 5Array Copying
int[] luckyNumbers = smallPrimes ;
luckyNumbers[3] = 12;
int [] copiedValues = Arrays.copyOf(luckyNumbers,
luckyNumbers.length);
Слайд 6Array Sorting
Arrays.sort(a);
Слайд 7Multidimensional Array
int [][] matrix = new int[2][3];
int [][] matrixInitialized = {{1,2}, {3,4},
{5,6}};
Слайд 8Ragged Array
Arrays in which different arrays have different length
1
1 1
1 2 1
1
3 3 1
1 4 6 4 1
Слайд 9Materials
https://www.hackerrank.com/lesson-5
Homework
Chapter 3.10 - 3.10.7 inclusive
Reading