issue getting program to compile
Here is my code:
import java.util.Scanner;
publicclass Vowels
{
static Scanner console =new Scanner(System.in);
publicstaticvoid main(String[] args)
{
char ch;
System.out.print("Enter a letter of the alphabet " +
"to see if it is a vowel: ");
ch = console.next().charAt(0);
System.out.println();
System.out.println(isVowel(char ch));
}
publicstaticboolean isVowel(char ch)
{
switch (ch)
{
case'a':case'e':case'i':case'o':case'u':
case'A':case'E':case'I':case'O':case'U':
returntrue;
}
returnfalse;
}
}
When compiled I get:
C:\temp\Vowels.java:19: '.class' expected
System.out.println(isVowel(char ch));
^
C:\temp\Vowels.java:19: ')' expected
System.out.println(isVowel(char ch));
^
2 errors
Tool completed with exit code 1
[/code]
Message was edited by:
mattvgt

