File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
REST with Spring (video course)
this week in the
Java in General
index of an element in an array
krishna prasad gunasekaran
Joined: Jul 25, 2006
Nov 04, 2007 05:20:00
hw to find the index of an element in an array.
have a great day,
Joined: Mar 06, 2001
Nov 04, 2007 06:00:00
java.util.List has an indexOf method (providing your equals method is implemented correctly), and can convert from an Array to a List using java.util.Arrays.asList
Joined: Sep 28, 2004
Nov 04, 2007 06:03:00
Well, if the elements of the array are sorted, then you could use the
class. Otherwise, I believe you have to loop through the array to find the element that you want.
Java Threads, 3rd Edition
Jini in a Nutshell
Java Gems (contributor)
I agree. Here's the link:
subject: index of an element in an array
Deleting duplicate element in an array
mock exam question
variable of interest
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015