Try to search your question here, if you can't find : Ask Any Question Now ?

What is difference between isEmpty() and size() for hashmap if used under if condition?

HomeCategory: stackoverflowWhat is difference between isEmpty() and size() for hashmap if used under if condition?
Avatarpushpa asked 3 months ago

I have to deal with NullPointerException which is occuring on Hashmap . Shall I use map.isEmpty() or (map.size() > 0) inside if condition? Which one is better?

1 Answers
Best Answer
AvatarArben answered 3 months ago
Your Answer

20 + 2 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com