hi, somebody explain me this program, especially line 9, this question from Inquisition scjp6 trail set mock exam,
public class testboxing
1. {
2. public static void main(
String []as)
3. {
4. String []words = new String[]{"aaa","bbb","ccc","aaa"};
5. Map<String,Integer>m = new Treemap<String,Integer>();
6. for(String
word:words)
7. {
8. Integer freq= m.get(word);
9. m.put(word,freq==null? 1:freq+1);
10. }
11. system.out.println(m);
12. }
13. }
the answer is {aaa=2,bbb=1,ccc=1}
is that question mark in line 9 is printing mistake, if it is, i cant understand that boxing & unboxing clearly,