Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ListaVetores;
- import javax.swing.*;
- public class Array0 {
- public static void main(String[] args) {
- int cont;
- int[] dados = new int[2];
- System.out.println(
- "O n. de elem do array é: "+dados.length);
- for (cont=0; cont<2; cont++) {
- dados[cont] = Integer.parseInt(
- JOptionPane.showInputDialog(
- "informe o valor pa ao indice "+cont));
- }
- for (int i=0;i<2;i++) {
- System.out.println(
- "O valor de indice "+i+
- "vale "+dados[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement