Click here to watch in Youtube :
https://www.youtube.com/watch?v=xdIeqrmgqDc&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
![]() |
Java Tutorial: Annotations in java | Java annotations [Annotations introduction] |
import java.util.ArrayList;
public class AnnotationsDemo
{
/*
* If you remove the @SuppressWarnings("unchecked")
* annotation, it will show warning at compile time
* because we are using non-generic collection.
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String args[])
{
ArrayList list = new ArrayList();
list.add("Ram");
list.add("Peter");
for (Object obj : list)
{
System.out.println(obj);
}
}
}
Click the below link to download the code:
No comments:
Post a Comment