File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes unique and non null values in String array ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "unique and non null values in String array ?" Watch "unique and non null values in String array ?" New topic
Author

unique and non null values in String array ?

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1368
How to strore unique and non null values in String array ?
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 2969
    
    9
Pretty much the same way you would store anything in an array. You're posting in Intermediate - have you ever used a Java array? It's mostly straightforward. If you have any difficulties, please tell us, more specifically, what you're having trouble with. We don't want to explain every step along the way, after all.

Alternately, I suspect that this question may have been misguided in the first place. I think the question should have been, how should I store unique, non-null values into some sort of object that collects them efficiently? And the answer would be: forget about arrays, and take a look at the Set interface. HashSet would be the obvious choice for an implementation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unique and non null values in String array ?
 
Similar Threads
hash map
mapy key and null vallues
How do I trim the null values from an array?
Array lengths
Printing the index of an array