How to suppress unchecked warnings in Java

By Angsuman Chakraborty, Gaea News Network
Monday, October 27, 2008

The best way to suppress unchecked or other warnings is to fix the cause of the warning. However in some rare cases, the warning is incorrect and there is no logical way to solve it without compromising the intended functionality. For such cases there is a simple solution:

Add the following just before the method definition:

@SuppressWarnings(”unchecked”)

This stops any unchecked warnings from the code within the method.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :