Quite often, when we compile our programs, we receive many warnings and errors. The compiler errors must be fixed, as they are typically syntactical in nature. The warnings, on the other hand, should be reviewed and appropriately addressed. Some of the warning messages are ignored by developers.
Java 9 provided a slight reduction in the number of warnings we received. Specifically, depreciation warnings caused by import statements were no longer generated. Prior to Java 9, we could suppress deprecated warning messages with the following annotation:
@SupressWarnings
Now the compiler will suppress depreciated warnings if one or more of the following cases is true:
- If the @Deprecated annotation is used
- If the @SuppressWarnings annotation is used
- If the use of the warning-generating code and the declaration are within the ancestor class
- If...