Mega Code Archive

 
Categories / Java Tutorial / Language
 

A demo for SuppressWarnings

Uses the SuppressWarnings annotation type to prevent the compiler from issuing unchecked and fallthrough warnings import java.io.File; import java.io.Serializable; import java.util.ArrayList; @SuppressWarnings (value={"unchecked", "serial"}) public class SuppressWarningsTest implements Serializable {     public void openFile () {         ArrayList a = new ArrayList ();         File file = new File ("X:/java/doc.txt");     } }