Baixe o app para aproveitar ainda mais
Prévia do material em texto
ATIVIDADE CONTEXTUALIZADA- CASE FINAL Danton Matheus Perasol 01495617 Tecnologia em Análise e Desenvolvimento de Sistemas import java.util.HashSet; class Main { public static void main(String[] args) { HashSet<Integer> hset = new HashSet<>(); long tempoInicial = System.currentTimeMillis(); //adiciona 10 mil elementos do tipo Int! for(int i = 1; i<=10000; i++){ hset.add(i); } //remove 5 mil elementos; for(int i = 0; i<5000; i++){ hset.remove(i); } long tempoTotal = System.currentTimeMillis() - tempoInicial; System.out.printf("o metodo executou em %d ms\n",tempoTotal); } }
Compartilhar