Faster than this?
Map<String,String> map = new HashMap<>();
if(keys.length == values.length){
for(int index = 0; index < keys.length; index++){
map.put(keys[index], values[index]);
}
}
More Related Contents:
- Can an array be used as a HashMap key?
- “Cannot create generic array of ..” – how to create an Array of Map?
- How to make HashMap work with Arrays as key?
- Java: how to convert HashMap to array
- Hashmap vs Array performance
- Creating a program to file criminal cases and then view them, with new case being allowed to add
- What are the differences between a HashMap and a Hashtable in Java?
- How do I declare and initialize an array in Java?
- How to initialize an array in Java?
- Are arrays passed by value or passed by reference in Java? [duplicate]
- Where is array’s length property defined?
- Java Array Sort descending?
- Check string for palindrome
- Java: Reading a file into an array
- How to map a PostgreSQL array with Hibernate
- Finding the second highest number in array
- Java Comparator class to sort arrays
- Why does my sorting loop seem to append an element where it shouldn’t?
- varargs and the ‘…’ argument
- Getting the array length of a 2D array in Java
- Deep copy of an object array
- Reversing an Array in Java [duplicate]
- Fastest way to set all values of an array?
- How to get unique items from an array?
- Is it possible to dynamically build a multi-dimensional array in Java?
- Java OutOfMemoryError in reading a large text file
- Why does printing a Java array show a memory location [duplicate]
- Converting an ArrayList into a 2D Array
- Return the index of clicked button?
- Create an array of ArrayList elements