This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 682

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: 2246

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: 682

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 ?
 
Similar Threads
using logic:eual or logic present
actionlistener and restricting size of button
arraylist
how to retrive session object / struts
valueChangeListener not called.