import java.io.PrintStream; import java.util.*; public class ReadAndReverse { static void readAndReverse (Scanner input, PrintStream output) { ArrayListL = new ArrayList (); while (input.hasNext()) L.add(input.next()); for (int k = L.size() - 1; k >= 0; k -=1) output.printf("%s ", L.get(k)); } public static void main (String [] args) { Scanner inp = new Scanner (System.in); readAndReverse (inp, System.out); } }
Wednesday, October 17, 2007
Java Library ArrayList
Subscribe to:
Post Comments (Atom)
Just some daily notes ...
Things I'm into now...
Blog Archive
-
▼
2007
(29)
-
▼
October
(15)
- Deconstructing a Scheme recursive function and imp...
- Anasi Boys
- Iterator for Collection and Nested Class
- The Uninvited!
- Inheritence and PolyMorphIsm
- Iterator Example
- Java Library ArrayList
- Inserting into an array non-destructively
- Singly linked list operations...
- PascalTriangles once more!
- Sieve of Erotosthenes
- Linked List Constructor Functionality Testing
- The Linked List Maker method
- Simple Linked List operations
- Old blogs before Day 0.
-
▼
October
(15)
1 comment:
Great article and you have indeed covered the Java Array list in great detail with code example. this is one of most useful class java API provides to us and detail knowledge of it really helps. I have also blogged about Java Arraylist in Java 5 some time back , may be you find interesting.
Post a Comment