Advertisement
cesarnascimento

numeros aleatorios loiane com for

Aug 17th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. package foreach.aula21;
  2.  
  3. import java.util.Random;
  4.  
  5. public class foreach {
  6.  
  7.     public static void main(String[] args) {
  8.         int [] notas = new int[10];
  9.        
  10.         Random random = new Random();
  11.        
  12.         for(int i = 0; i<notas.length; i++){
  13.             notas[i] = random.nextInt(10);
  14.         }
  15.        
  16.         for(int i = 0; i<notas.length;i++){
  17.             System.out.println(notas[i]);
  18.         }
  19.        
  20.     }
  21.     /* César N. */
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement