MENU

Fun & Interesting

Learn ARRAYS in 9 minutes! 🍎

Bro Code 9,476 5 months ago
Video Not Working? Fix It Now

#java #javatutorial #javacourse import java.util.Arrays; public class Main { public static void main(String[] args){ // array = a collection of values of the same data type // * think of it as a variable that can store more than 1 value * String[] fruits = {"apple", "orange", "banana", "coconut"}; //fruits[0] = "pineapple"; //int numOfFruits = fruits.length; //Arrays.sort(fruits); //Arrays.fill(fruits, "pineapple"); for(String fruit : fruits){ System.out.println(fruit); } } }

Comment