Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

#30 jagged and 3D Array in Java

Автор: Telusko

Загружено: 2023-01-17

Просмотров: 227667

Описание:

Check out our courses:

Java Spring Boot AI Live Course: https://go.telusko.com/JavaSpringBootAI
Coupon: TELUSKO20 (20% Discount)

AI Powered DevOps with AWS - Live Course :- https://go.telusko.com/AIDevOps-AWS
Coupon: TELUSKO20 (20% Discount)

Master Java Spring Development : https://go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)

For More Queries WhatsApp or Call on : +919008963671

website : https://courses.telusko.com/


Udemy Courses:

Spring: https://go.telusko.com/udemyteluskosp...
Java:- https://go.telusko.com/udemyteluskojava
Java Spring:- https://go.telusko.com/Udemyjavaspring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopy...
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodo...

Instagram :   / navinreddyofficial  
Linkedin :   / navinreddy20  
TELUSKO Android App : https://go.telusko.com/TELUSKOAPP
TELUSKO IOS App : https://apple.co/3SsgmU2
Discord :   / discord  

In this lecture we are discussing:
1)What if array of array of different size ?
2)Jagged array concept
3)If i donot know column size of array
4)traverse the array using for loop and enhance loop

#1
Suppose we want to create a 2d dimensional array such that it has
5 rows but we donot know for each row we need different size for column.
for that we go for array of array of different size

-------------
| 1 | 2 | 3 |
---------------------
| 4 | 5 | 6 | 7 | 8 |
-------------------------
| 1 | 5 | 9 | 2 | 4 | 7 |
-------------------------

in above diagram we have three rows and first row has 3 elements
second row has 5 elements and third row has 6 elements.

#2#3
jagged array concept come in java 8
-- Jagged array is a multidimensional array where member arrays are of different size. For example, we can
create a 2D array where first array is of 3 elements, and is of 4 elements. Following is the example demonstrating
the concept of jagged array.

syntax to create --

int nums[][]=new int[3][];
nums[0] =new int[3];
nums[1] =new int[5];
nums[2] =new int[6];

initalize value in array using random()method present in Math class
for(int i=0;i nums.length;i++){
for(int j=0;j nums[i].length;j++){
nums[i][j]=(int)(Math.random()*10);
}
}
#5
Traverse using for loop :
for(int i=0;i nums.length;i++){
for(int j=0;j nums[i].length;j++){
System.out.print(nums[i][j]+" ");
}
}

Traverse using enhanced for loop:
for(int x[]:nums){
for(int y:x){
System.out.println(y);
}
}

Note: Just like 2-d jagged array we can create 3-d , 4-d jagged array
for cursoity:
int num[][][]=new int[3][][];
num[0]=new int[2][];
num[1]=new int[3][];
num[2]=new int[4][];
num[0][0]=new int[2];
num[0][1]=new int[3];
num[1][0]=new int[4];
num[1][1]=new int[5];
num[1][2]=new int[6];
num[2][0]=new int[7];
num[2][1]=new int[8];
num[2][2]=new int[9];
num[2][3]=new int[10];

Intialize the array:
for(int i=0;i num.length;i++){
for(int j=0;j num[i].length;j++){
for(int k=0;k num[i][j].length;k++){
num[i][j][k]=(int)(Math.random()*10);
}
}
}

Traverse the element of array:
for(int i=0;i num.length;i++){
for(int j=0;j num[i].length;j++){
for(int k=0;k num[i][j].length;k++){
System.out.print(num[i][j][k]+" ");
}
}
}

Github repo : https://github.com/navinreddy20/Javac...

More Learning :

Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6

JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq

Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA

Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB

NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L

Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20
https://www.telusko.com

#30 jagged and 3D Array in Java

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

#31 Drawbacks of Array in Java

#31 Drawbacks of Array in Java

#29 Multi Dimensional Array in Java

#29 Multi Dimensional Array in Java

#26 Stack And Heap in Java

#26 Stack And Heap in Java

lofi hip hop radio 📚 beats to relax/study to

lofi hip hop radio 📚 beats to relax/study to

Ways to Split Array Into Three Subarrays| Medium Made Easy | Leetcode 1712 | Codehurdle

Ways to Split Array Into Three Subarrays| Medium Made Easy | Leetcode 1712 | Codehurdle

#32 Array of Objects in Java

#32 Array of Objects in Java

Java Tutorial For beginners

Java Tutorial For beginners

Учебник Java по двумерным массивам №11

Учебник Java по двумерным массивам №11

Live Coding LeetCode – Unfiltered Problem Solving--DAY 159

Live Coding LeetCode – Unfiltered Problem Solving--DAY 159

#40 Encapsulation in Java

#40 Encapsulation in Java

#95 Comparator vs Comparable in Java

#95 Comparator vs Comparable in Java

Introduction to Arrays and ArrayList in Java

Introduction to Arrays and ArrayList in Java

Introduction to Three-Dimensional (3D) Arrays

Introduction to Three-Dimensional (3D) Arrays

#28 Creation of Array in Java

#28 Creation of Array in Java

Czy Chiny szykują się na upadek Rosji?

Czy Chiny szykują się na upadek Rosji?

Функциональный интерфейс | Лямбда-выражения в Java

Функциональный интерфейс | Лямбда-выражения в Java

#35 Mutable vs Immutable String in Java

#35 Mutable vs Immutable String in Java

#37 Static Variable in Java

#37 Static Variable in Java

Java Tutorial For Beginners | 3D Array In Java Programming | Arrays For Beginners | SimpliCode

Java Tutorial For Beginners | 3D Array In Java Programming | Arrays For Beginners | SimpliCode

Three Dimensional Arrays in Java || Lesson 56 || Java Programming || Learning Monkey ||

Three Dimensional Arrays in Java || Lesson 56 || Java Programming || Learning Monkey ||

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]