0
respostas

Criando um Map de clientes

public class Principal {
    public static void main(String[] args) {
        Map<Integer, String> registrosDeClientes = new HashMap<>();

        registrosDeClientes.put(1, "Bárbara");
        registrosDeClientes.put(2, "Ana Maria");
        registrosDeClientes.put(3, "Mikael");

        System.out.println("O nome do Cliente com ID 2 é: " + registrosDeClientes.get(2));

    }
}