Friday, 9 June 2017

Java Tutorial: Annotations in java | Java annotations [Annotations introduction] ~ foundjava


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] 
AnnotationsDemo.java
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:

CLICK HERE

No comments:

Post a Comment