Arrays & ArrayLists Java

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

10 Terms

1
New cards

An ArrayList containing Strings, named arr.

ArrayList<String> arr = new ArrayList<String>();

2
New cards

An ArrayList containing whole numbers, named arr.

ArrayList<Integer> arr = new ArrayList<Integer>();

3
New cards

Add an item to an ArrayList called arr.

arr.add();

4
New cards

Change the 3rd item, in an ArrayList of Strings called arr, to "Puppy".

arr.set(3, "Puppy");

5
New cards

How long an ArrayList called arr is.

arr.size();

6
New cards

Get an item from an ArrayList called arr.

arr.get();

7
New cards

An Array containing Strings, named arr, with 5 items.

String[] arr = new String[5];

8
New cards

An Array containing Strings, named arr, with "Cat", "Bird", "Dog", "Fish" in it.

String[] arr = {"Cat", "Bird", "Dog", "Fish"};

9
New cards

Change the 3rd item, in an Array of Strings called arr, to "Puppy".

arr[3] = "Puppy";

10
New cards

How long an Array called arr is.

arr.length;