Search:

Type: Posts; User: javapenguin

Search: Search took 0.08 seconds.

  1. Replies
    6
    Views
    1,901

    Re: text.length method problem?

    Hmmm. Maybe console needs to be static.

    Yep, now it works:


    import java.util.*;

    public class Vowels{
    static Scanner console = new Scanner(System.in);
    public static void main(String[]...
  2. Replies
    6
    Views
    1,901

    Re: text.length method problem?

    String.trim() will return a copy of the String without trailing and preceding whitespaces.

    The number of vowels in that String should be the same as the full String that has the spaces.

    ...
Results 1 to 2 of 2