import java.util.*;

public class al{

    public static void main(String[] args){
        List l = new ArrayList();

        Object a = "hello";
        l.add(a);
        l.add("asdasd");
        l.add("hgdfsdfshjk");
        System.out.println(l.isEmpty()+"");
        System.out.println(l.get(0));
        for(int i=0;i<l.size();i++){
            String b = (String)l.get(i);
            System.out.println(b);
        }




    }
}

i still havent figured out how to solve the warning it gives. can someone esplain to me the warning and maybe you could teach me how to properly use collections.

thanks

If you have JDK 1.5 it is because you are not using Generics.

Read about Generics in the New Features portion of the Java SE 5 documentation on Sun.

http://java.sun.com/j2se/1.5.0/docs/index.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.