-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeste.java
More file actions
48 lines (30 loc) · 1005 Bytes
/
Teste.java
File metadata and controls
48 lines (30 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package br.com.byteban.banco.test.util;
import java.util.ArrayList;
import br.com.byteban.banco.modelo.Conta;
import br.com.byteban.banco.modelo.ContaCorrente;
public class Teste {
public static void main(String[] args) {
ArrayList lista = new ArrayList();
Conta cc = new ContaCorrente(22, 11);
lista.add(cc);
Conta cc2 = new ContaCorrente(22, 22);
lista.add(cc2);
System.out.println("Tamanho: " + lista.size());
Conta ref = (Conta) lista.get(0);
System.out.println(ref.getNumero());
lista.remove(0);
System.out.println("Tamanho: " + lista.size());
Conta cc3 = new ContaCorrente(33, 311);
lista.add(cc3);
Conta cc4 = new ContaCorrente(33, 322);
lista.add(cc4);
for (int i = 0; i < lista.size(); i++) {
Object oRef = lista.get(i);
System.out.println(oRef);
}
System.out.println("-------------------------");
for (Object oRef: lista) {
System.out.println(oRef);
}
}
}