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