954,184 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

unsafe operation

[code=java]
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

Covinus
Junior Poster
112 posts since Mar 2006
Reputation Points: 31
Solved Threads: 0
 

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

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You