最佳答案
I am looking to find the index of a given element, knowing its contents, in Java.
I tried the following example, which does not work:
class masi {
public static void main( String[] args ) {
char[] list = {'m', 'e', 'y'};
// should print 1
System.out.println(list[] == "e");
}
}
Can anyone please explain what is wrong with this and what I need to do to fix it?