-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAula0045.java
More file actions
21 lines (19 loc) · 786 Bytes
/
Aula0045.java
File metadata and controls
21 lines (19 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
:: SITE: eXcript.com
:: FB: fb.com/eXcript
:: URL: youtube.com/watch?v=_s7MDIlE5is&list=PLesCEcYj003Rfzs39Y4Bs_chpkE276-gD
:: NOME: Curso de Java - Aula 45 - Formatando textos em colunas (string)
*/
public class Aula0045 {
public static void main(String[] args) {
int[] array;//declaração do nosso array
array = new int[10]; //cria e reserva o espaço para o nosso array
System.out.printf("%s%10s\n", " _______", " ________ ");
System.out.printf("%s%10s\n", "|Indice " ,"| Valores|");
System.out.printf("%s%10s\n", "|-------", "|--------|");
for ( int i = 0; i <= 9; i++ ) {
System.out.printf("|%5d%3s%7d |\n", i, " |", array[i]);
}
System.out.printf("%s%10s\n", "|-------", "|--------|");
}
}