You are viewing a single comment's thread. Return to all comments →
for(String str : a)
can you explain it
It is similar to for loop in c,c++. We are comparing each element in ArrayList with given strings and incrementing the count value
its for each loop same as basic for loop with auto increment(auto i++), was not there in earlier verions of java included in Java5 version.