ArrayList and Scanner

How do I scan different values into an ArrayList array? I want the user to be able to input an integer, double, or string and then have it be stored in 1 of 3 arraylists. How do I accomplish this?
[203 byte] By [javanarba] at [2007-11-27 1:48:19]
# 1

> How do I scan different values into an ArrayList

> array?

An ArrayList is not an array. It's an implementation of the java.util.List interface:

http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html

> I want the user to be able to input an

> integer, double, or string and then have it be stored

> in 1 of 3 arraylists. How do I accomplish this?

Have a look at the API docs of the Scanner class (including example code):

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html

Good luck.

prometheuzza at 2007-7-12 1:12:16 > top of Java-index,Java Essentials,New To Java...
# 2
Collections: http://java.sun.com/docs/books/tutorial/collections/index.htmlScanner: http://java.sun.com/docs/books/tutorial/essential/io/scanning.html
DrLaszloJamfa at 2007-7-12 1:12:16 > top of Java-index,Java Essentials,New To Java...
# 3
Nice short to-the-point [url http://java.sun.com/developer/JDCTechTips/2004/tt1201.html#1]T-Tip[/url]
abillconsla at 2007-7-12 1:12:16 > top of Java-index,Java Essentials,New To Java...