In that case you should use eg. java.util.Vector or java.util.LinkedList. Arrays in java are static and their size must be defined on creation.
Adding an object to a Vector (as the last element: vector.add(object);
Getting an object from a Vector at the index i: obj = vector.getElementAt(i);
iterating through the vector:
Enumeration e = vector.getElements();
while (e.hasMoreElements()) System.out.println(e.nextElement());
Getting the elements as an array:
Object[] objs = vector.toArray();
...
Check out the ArrayList class
http://java.sun.com/j2se/1.3/docs/api/java/util/ArrayList.html
> can we any way use any array with out giving it's
> length.
>
> i wanna declare a array and get input from std.in and
> store in a array. i do not know the size of the array
> before hand!!!
>
>
> -D.K