Originally posted by Sridhar Santhanakrishnan:
The following code runs just fine without any compile or runtime errors.
You are right But It's not the errors OP is talking about.
Compiler Warnings !!
Here your add operation should give one warning if you are using JDK 5 or above since Vector is not declared as typed (this case Integer). Should be
And the 2nd Warning because sort method's signature is
You may go through the
API for Collections class.