Ajude a dar forma ao GoConqr. O que a gente deve adicionar?

Mapa mental

Array

Tate Johnson Computer Science Inglês

Mind map about Java arrays: declaring arrays, indexing with for-each, two dimensional arrays and copying arrays

Mind map: Java arrays

Conteúdo do mapa

Array

  1. Very similar to dictionaries in Python

    • The size of an array can't be change
  2. How to declare/instantiate: elementType[] varName = new elementType[arraySize];

    • Example:String[] stringHolder = new String[5]
    • Setting the values of an array: varName[index] = value;
    • Checking the length: varName.length (no parentheses)
    • Can also initialize it like this: String[] stringHolder = {value1, value2, value3}
  3. Indexing through an array: for-each loop

    • Example: for(elementType element: nameofArray)
      • for(double d1: stringHolder)
  4. Two Dimensional Arrays

    • Declare: int[][] array2d;
      • array2d = new int[3][10]
  5. Copying Arrays:

    • Use a loop to copy the individual elements
    • use static arraycopy method in System class
      • arraycopy(sourceArray, sourcePosition, targetArray, targetPosition, length)
    • Use clone method to copy arrays.

Informações

Descrição
Computer Science Mapa Mental sobre Array, criado por Tate Johnson em 27-04-2021.
Criado por
Tate Johnson
Visualizações
59
Tags
array
Avaliação

Mais sobre Arrays

Fale Conosco

Sobre o que é sua mensagem?

O que a gente deve adicionar?