Link to home
Start Free TrialLog in
Avatar of new_foxpro
new_foxpro

asked on

INDEXES

how to create indexes in Java?
Avatar of sudhakar_koundinya
sudhakar_koundinya

what do you mean by index here??
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The java.util.List interface provides an ordered collection that allows you to access its elements by index.
So any class that implements this interface would allow you to access its elements by index.


For example

List myList = new ArrayList();
myList.add("Item 1");
myList.add("Item 2");
String firstItem = (String)myList.get(0); // returns the 1st item

regards,

Freedom
:-)