Arrays and ArrayLists
Build lists of data with Java arrays and ArrayLists.
StartKey Concepts
Review core concepts you need to learn to master this subject
Index
Arrays
Array creation in Java
Changing an Element Value
Java ArrayList
Modifying ArrayLists in Java
Index
Index
int[] marks = {50, 55, 60, 70, 80};
System.out.println(marks[0]);
// Output: 50
System.out.println(marks[4]);
// Output: 80
An index refers to an element’s position within an array.
The index of an array starts from 0 and goes up to one less than the total length of the array.
Learn Java: Arrays
Lesson 1 of 2
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory