Advertisement
cesarnascimento

array unidimensional aula 44

May 25th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1.  
  2. public class exript {
  3.  
  4.     public static void main(String[] args) {
  5.         int[] array; // declaraçao do array
  6.         array = new int[10]; // cria e reserva espaço p array
  7.        
  8.         for( int i = 0; i <= 9; i++){
  9.             System.out.printf("%5d%7d\n",i,array[i]);
  10.         }
  11.        
  12.  
  13.     }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement