AP Comp Sci A

Subdecks (4)

Cards (43)

  • System.out.print() - statement which prints the argument passed to it. Does not add a new line.
  • System.out.println() - statement which prints the argument passed and adds a new line after it.
  • Declare array: (datatype)[] (arrayname);
    Initialize array(1): (arrayname) = new (datatype) [] {element,element,...,};
    Initialize array(2): (arrayname) = new (datatype) [space#];
  • Declare and Initialize(1): (datatype) (arrayname)[] = {element,element,...,};

    Declare and Initialize(2): (datatype) (arrayname)[] = new (datatype) [space#];
  • Array indexing starts at zero.
  • initialize/change element at an index: arrayname[index] = value;
  • arrayname.length: Finds the length of the array.
  • Declare and Initialize(2): (datatype) (arrayname)[] = new (datatype) [space#];
  • Declare and Initialize(1): (datatype) (arrayname)[] = {element,element};