import java.util.ArrayList;
public class Contato {
String nome;
String telefone;
public Contato(String nome, String telefone) {
this.nome = nome;
this.telefone = telefone;
}
static void exibir(ArrayList<Contato> lista){
int contador = 1;
for (Contato c : lista){
System.out.print(contador +". "+c.getNome() + " - " + c.getTelefone()+ "\n");
contador++;
}
}
public String getNome() {
return nome;
}
public String getTelefone() {
return telefone;
}
public static void main(String[] args) {
ArrayList<Contato> contatos = new ArrayList<>();
contatos.add(new Contato("João Silva", "(11) 99999-0000"));
contatos.add(new Contato("Luana Santos", "(21) 98888-0000"));
contatos.add(new Contato("Pedro Oliveira", "(31) 97777-0000"));
exibir(contatos);
}
}