- Map is an interface
- Part of Collection
- Key and value pair
- Usage: Search, edit and delete elements respective to key
- Map doesn't allow duplicate keys.
- Hashmap will allow null keys and values
- Methods: getKey(), getValue(), entrylist
public static void listcheck() {
Map<String,String> hmap= new HashMap<String,String>();
hmap.put("urigetuser","https://reqres.in/api/users?page=2");
hmap.put("first_name","janet");
Set<String> hset = new HashSet<String>();
Set<Entry<String, String>> esets = hmap.entrySet();
for (Map.Entry<String, String> ent : esets) {
System.out.print(ent.getKey() + ent.getValue());
}
}
*************************************************
API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
No comments:
Post a Comment