tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Schumacher <felix.schumac...@internetallee.de>
Subject Re: hi,wired problem? add 0 into alist but get 1 as a result!
Date Mon, 21 May 2007 17:55:36 GMT
Am Montag, den 21.05.2007, 13:54 +0800 schrieb Peter:
> hi all,
> 
> I have come into a very wired problem.
> 
> here it is.
> my project using JBuilder 2006 and tomcat 5.5.20.
> when i put a 0 into a list and get 1 as a result.
> simple code for testing!
> 
> List alist =new ArrayList();
> alist.add(0);  put 0 into it
> alist.get(0);   get 1 as result.
Have you tried to put an Object into ArrayList? 
Like
alist.add(Integer.valueOf(0));
System.out.println((Integer)alist.get(0));

I don't think it is possible to store an int into an ArrayList.

Bye
 Felix


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message