Answers for "How to get all the key in map in array"

0

How to get all the key in map in array

Set<Integer> keys = map.keySet();
	
	int[] array = new int[keys.size()];
    int index = 0;
    for(Integer element : keys) array[index++] = element.intValue();
    
	for(int i : array) System.out.println(i);
Posted by: Guest on March-14-2021

Code answers related to "How to get all the key in map in array"

Browse Popular Code Answers by Language