Learn Java 2D arrays in 9 minutes! ⬜ @BroCodez
Learn Java 2D arrays in 9 minutes! ⬜  @BroCodez
Uploaded December 2024 | Updated September 2026, 2 weeks ago
#java #javatutorial #javacourse

public class Main {
public static void main(String[] args){

// 2D array = An array where each element is an array
// Useful for storing a matrix of data

//-----------------------
// EXAMPLE 1
//-----------------------

String[][] groceries = {{"apple", "orange", "banana"},
{"potato", "onion", "carrot"},
{"chicken", "pork", "beef", "fish"}};

groceries[2][1] = "eggs";

for(String[] foods : groceries){
for(String food : foods){
System.out.print(food + " ");
}
System.out.println();
}

//-----------------------
// EXAMPLE 2
//-----------------------

char[][] telephone = {{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}};

for(char[] row : telephone){
for(char number : row){
System.out.print(number + " ");
}
System.out.println();
}
}
}
Learn Java 2D arrays in 9 minutes! ⬜Random numbers in NumPy are easy! 🎲User input in Java is easy! ⌨️Logical operators are ❗easyStart coding with PYTHON in 5 minutes! 🐍Import files in Pandas easy! 📥Learn Java threading in 10 minutes! 🧵Java variables are easy! ❎MongoDB logical operators explainedCode a stopwatch using Python! ⏱Python PyQt5 setup a basic GUI Application! 🖥️Learn NumPy in 1 hour! 🔢
Bro Code |

Learn Java 2D arrays in 9 minutes! ⬜

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER