What do @SuppressWarnings("deprecation") and ("unused") mean in Java?

Praveenkumar picture Praveenkumar · Sep 13, 2011 · Viewed 95.1k times · Source

What do these lines in my Java or Android project mean?

@SuppressWarnings("deprecation")
@SuppressWarnings("unused")

Answer

nfechner picture nfechner · Sep 13, 2011

The @SuppressWarnings annotation disables certain compiler warnings. In this case, the warning about deprecated code ("deprecation") and unused local variables or unused private methods ("unused"). This article explains the possible values.