Vote Up 0 Vote Down

Search element for Position

We would like to know how to search element for Position.

answer


Vote Up 0 Vote Down
import java.util.Arrays;
import java.util.List;
public class MainClass {
  public static void main(String[] a) {
    List list = Arrays.asList(new String[] { "A", "B", "C", "D" });
    System.out.println(list.lastIndexOf("A"));
  }
}
flag | link

your answer

Who Are You?

Have an account already? Login before answering!