Pages

Monday, August 13, 2012

Generic_Example

public class Generic_IN
{
    public static void main(String args[])
    {
       ArrayList newStyle= new ArrayList();
       newStyle.add(new String("abc0"));
     //  newStyle.add(new Int(10));
       newStyle.add("abc2");
       newStyle.add("101");

       Iterator it = newStyle.iterator();

       while(it.hasNext())
       {
           System.out.println(it.next());
       }



       
    }

}

No comments:

Post a Comment