Explore
Connect
Documentation
Snippets
Log in
Sign up
1
2
3
4
5
6
7
8
9
10
11
12
13
14
public
class
ArrayExample {
public
static
void
main(
final
String
[] args) {
final
int
n =
10
;
final
int
[] ar =
new
int
[n];
for
(
int
i =
0
; i < ar.length; i++) {
ar[i] = i;
}
for
(
final
int
e
:
ar) {
System.out.print(e +
" "
);
}
}
}
Enter to Rename, Shift+Enter to Preview
Run