What is the difference between
One example .. you can use
Integer as the key of
HashMap but you can't use int. Because an
Object is needed.
So where you need an
int value as an object there you need to use
++i is pre increment i++ is post increment
i = 0; System.out.println(i++) //will print 0 then the i will be 1.
i = 0; System.out.println(++i) // here i wil be incremented first then print 1.