how to get index value of an arraylist
hi i have an arraylist and i need to get a index value of a certain element and i am passing that element as a String.... like arraylist.method(string elementname) ..... here for getting the index value of the element which method i have to use... thnx
arraylist.indexOf(element)
Or do you mean you have a String elementname that is related to an object, so you want to find the object through the use of the related elementname? This sounds like a HashMap would be better than an array list.
Or may be the object should have a name field.