Good evening everyone! It seems a lie that stuck in a very simple task, I have the following java code that consists of a simple constructor that contains an integer.
Yes or if I have to use Java 7 for the implementation.
List<Prueba> prueba = new ArrayList<Prueba>();
prueba.add(new Prueba(1,"Prueba"));
prueba.add(new Prueba(3,"Prueba1"));
prueba.add(new Prueba(2,"Prueba2"));
prueba.add(new Prueba(2,"Prueba2"));
prueba.add(new Prueba(1,"Prueba"));
System.out.println("#1 normal for loop");
for (int i = 0; i < prueba.size(); i++) {
System.out.println(prueba.get(i).getPrueba());
}
Well, I have a problem I need to group the repeated items and on the other hand count how many times the elements are repeated.
Any help? Thank you ! :)