Questions tagged as 'hashmap'

5
answers

What is the best way to iterate objects in a HashMap?

What is the best way to iterate the objects in a HashMap in Java in order to have access to the key and value of each entry?     
asked by 11.12.2013 / 17:01
1
answer

What are the differences between HashMap and Hashtable?

What are the differences between HashMap and Hashtable in Java? Which is more efficient?     
asked by 25.08.2015 / 21:20
1
answer

Difference between HashMap and TreeMap

What are the main differences between HashMap and TreeMap ? In relation to the use, in which situations is the use of each one recommended?     
asked by 08.11.2018 / 12:12
1
answer

How to put variables within vectors?

How do I create variables within a vector? Something like: int arr[] = {int x=1, int y = 2};     
asked by 17.12.2014 / 23:13
1
answer

Why should not iterate a hashmap?

I've been doing a project and one of my colleagues mentioned that iterating hashmaps is something to avoid and instead should use hashmap . However, I think the hashmap's versatility of being able to save strings as a key allows you to...
asked by 10.01.2018 / 21:25
2
answers

How to compare the value of a HashMapchave, value with a variable?

I have a HashMap aluno<Integer, Float> , where the key Integer will be the student's enrollment number, and the Float value will be the student's grade. I got the grades average using Iterator , but now I need...
asked by 20.11.2014 / 15:58
1
answer

Handling of HashMap between classes (Interpretation and Application)

It's my first question, sorry for the extension, I'm in the following exercise:    Create a Pizza class that has the methodIngredient () that   receives a String with the ingredient to be added. This class   you must also have the getPreco ()...
asked by 13.01.2017 / 03:34
1
answer

Difference hashmap and arraylist

Could anyone explain the difference between HashMap and ArrayList ?     
asked by 05.06.2017 / 20:30
1
answer

How to use a counter within a HashMap?

Is it possible to do this? public static void main(String[] args) { Scanner in = new Scanner (System.in); Map <String,Integer> mapa = new HashMap <String,Integer>(); mapa.put("45 - Jose" , ? ); //A "Key" deve ser o...
asked by 16.05.2016 / 04:36
1
answer

Hash Tables

I have a closed hash table with open addressing and linear probing for the following dictionary of words in a text; The input operation works like this: 1) The program asks for the first line of the text (with a limit of 100 characters)...
asked by 27.10.2014 / 16:59