Online Programming Server

Login

Login with facebook [?]

Facebook

Tutorial 57: CSC1130S - Lecture 8a: Array of Table

You are here: Tutorials >> Basic >> Java >> Introduction to Computing Using Java >> CSC1130S - Lecture 8a: Array of Table

Tutorial ID57
TitleCSC1130S - Lecture 8a: Array of Table

Array

  • If we need 3 integer variables, we type:
  • int i, j, k;
  • If we need 1000 integer variables...?!
  • we want to use an index to access variables of the same name (identifier) and type:
  • i[0] = 5;
    i[654] = -378;
  • How to do that?
  • int[] i = new int[1000];
  • OR ( C++ style )
  • int i[] = new int[1000];
integer array type (a collection of integers)

Post Your Comment

Title
Message