Save
AP Comp Sci A
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Daniel Moore
Visit profile
Subdecks (4)
Superclasses & Subclasses
AP Comp Sci A
5 cards
Math Methods
AP Comp Sci A
9 cards
String Methods
AP Comp Sci A
11 cards
ArrayLists
AP Comp Sci A
9 cards
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};
See all 43 cards