Welcome to JavaRanch.
Please UseCodeTags when you post a code at JavaRanch. Please edit your post and add code tags.
Not related to Servlets - Moving to BG...
Consider what would be if this assignment was legal:
In this code in line 6 we get Object from the list that is declared that can contain only Numbers.
This breaks program with ClassCastException.
To avoid situation like this, compiler prevents assignment in line 04.