Services Work Learn About Contact
0/10
Lesson 5 of 10

Arrays

Arrays in Java have a fixed size and store elements of the same type. Declare them with square brackets. Use the length property to get the size.

JAVA
int[] numbers = {10, 20, 30, 40};
String[] names = new String[3];

names[0] = "Ali";
names[1] = "Sara";

System.out.println(numbers[0]); // 10
System.out.println(names.length); // 3
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed Java!

You finished all 10 lessons and quizzes. You now know the basics of Java.