Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package foreach.aula21;
- import java.util.Random;
- public class foreach {
- public static void main(String[] args) {
- int [] notas = new int[10];
- Random random = new Random();
- for(int i = 0; i<notas.length; i++){
- notas[i] = random.nextInt(10);
- }
- for(int i = 0; i<notas.length;i++){
- int nota = notas[i];
- System.out.println(notas[i]);
- }
- System.out.println("usando for each");
- for(int nota : notas){
- System.out.println(nota);
- }
- }
- /* César N. */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement