File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to check whether a value is there in the ArrayList or not ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to check whether a value is there in the ArrayList or not ?" Watch "how to check whether a value is there in the ArrayList or not ?" New topic
Author

how to check whether a value is there in the ArrayList or not ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

suppose i have a data structure ArrayList that has 10 values say 1 2 3 and so on ...
and i have a textfield where user is entering a value something between 1 to 10 now i need to check whether the value entered by the user is there in the ArrayList or not
how to do this ? please explain


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2267
    
    3

How about ArrayList#contains(Object)?


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

Roberto Perillo wrote:How about ArrayList#contains(Object)?

thanks mate
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to check whether a value is there in the ArrayList or not ?