title: java how to display all vowels in user input String
body: <p>I'm trying to let user input a string then displays all the vowels found in the user input string, this is my code but it couldn't display the correct results.</p>
  
  <p>If the user input: <code>I'm desperate</code></p>
  
  <p>The result should be all the vowels in the string: <code>i, e, e, a, e</code></p>
  
  <pre><code>import java.util.Scanner;
  
  public class Lab7stringvowels {
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
  
      Scanner input = new Scanner (System.in);
      System.out.println ("Enter a string:");
      String s = input.nextLine();
  
      char [] sChars = s.toCharArray();
      char[] vowels = {'a','e','i','o','u'}; 
          for (int j = 0 ; j &lt; sChars.length ; j ++ ) {   
              for (int i = 0; i &lt; vowels.length ; i++ ) {
  
           if ( sChars == vowels) {
               System.out.print(vowels[i] + "  ");
           }
         }
       }
      }
  }
  </code></pre>