FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java_Learning/28_ArrayList/MultiDArrayList.java at main · TORRYNN/Java_Learning · GitHub
TORRYNN
/
Java_Learning
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java_Learning
/
28_ArrayList
/
MultiDArrayList.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (25 loc) · 1006 Bytes
Breadcrumbs
Java_Learning
/
28_ArrayList
/
MultiDArrayList.java
Copy path
File metadata and controls
27 lines (25 loc) · 1006 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import
java
.
util
.
ArrayList
;
import
java
.
util
.
Arrays
;
import
java
.
util
.
List
;
public
class
MultiDArrayList
{
public
static
void
main
(
String
[]
args
) {
List
<
List
<
Integer
>>
mainlist
=
new
ArrayList
<>();
List
<
Integer
>
list1
=
new
ArrayList
<>(
Arrays
.
asList
(
1
,
2
,
3
,
4
,
5
));
List
<
Integer
>
list2
=
new
ArrayList
<>(
Arrays
.
asList
(
2
,
4
,
6
,
8
,
10
));
List
<
Integer
>
list3
=
new
ArrayList
<>(
Arrays
.
asList
(
3
,
6
,
9
,
12
,
15
));
mainlist
.
add
(
list1
);
mainlist
.
add
(
list2
);
mainlist
.
add
(
list3
);
// Print the list
System
.
out
.
println
(
mainlist
);
System
.
out
.
println
(
"----------------------------------------------------------------"
);
// Printing the element of list
for
(
int
i
=
0
;
i
<
mainlist
.
size
();
i
++) {
List
<
Integer
>
list
=
mainlist
.
get
(
i
);
for
(
int
j
=
0
;
j
<
list
.
size
();
j
++) {
System
.
out
.
print
(
list
.
get
(
j
) +
" "
);
}
System
.
out
.
println
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL