First of all, I want to describe that there are more than five thousand records. Please let me know the best method for best performance from the following:
String hmVALUE = "";
try
{
hmVALUE = hashmapRECORDS.get(key).toString();
}
catch(Exception ex)
{
hmVALUE = "";
}
// Second method:
String hmVALUE = "";
if(Module.hmQUEUED_REQUESTS.containsKey(key))
{
hmVALUE = hashmapRECORDS.get(key).toString();
}
else
{
hmVALUE = "";
}
I am using try-catch and want to know which method is best.