wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 688

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: 2258
    
    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: 688

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

thanks mate
 
 
subject: how to check whether a value is there in the ArrayList or not ?
 
Similar Threads
valueChangeListener not called.
actionlistener and restricting size of button
using logic:eual or logic present
how to retrive session object / struts
arraylist