/home/leticia/NetBeansProjects/AumentoDeVetor/src/aumentodevetor/AumentoDeVetor.java |
1 package aumentodevetor;
2
3 public class AumentoDeVetor {
4
5 public static void main(String[] args) {
6 int n=10;
7
8 int vet[] = new int[n];
9 for(int i=0;i<=9;i++){
10 vet[i]=i;
11 }
12 System.out.println("vet tem tamanho: "+vet.length);
13
14 int v[]=new int[n*2];
15
16 for(int i=0;i<vet.length;i++){
17 v[i]=vet[i];
18 }
19
20 vet=v;
21 for(int i=0;i<=9;i++){
22 System.out.println(vet[i]);
23 }
24 System.out.println("vet tem tamanho: "+vet.length);
25 }
26 }