Answers for "java map default value"

1

java map default value

Map<String,String> data=new HashMap<>();
String someValue=data.getOrDefault("test","");//gets the value of "test" or "" if it does not exist
Posted by: Guest on April-05-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language