@SuppressWarnings 使用

@SuppressWarnings註解主要用在取消一些編譯器產生的警告 如圖所示: 【加註解之前】 【加註解之後】 這時候我們在方法上加上@SuppressWarnings註解就可以消除這些警告的產生,註解的使用有三種: @SuppressWarnings(「unchecked」) [^ 抑制單類型的警告] @SuppressWarnings(「unchecked」,「rawtypes」) [^
相關文章
相關標籤/搜索