Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

charAt equals element of array

843785Jan 8 2009 — edited Jan 8 2009
Like to check whether some character equals some character out of an array I defined.

	
        char [] vowels = new char[5];
	vowels[0] = ('a');
	vowels[1] = ('e');
	vowels[2] = ('i');
	vowels[3] = ('o');
	vowels[4] = ('u');
	
	if (verb.charAt(verb.length()-1)=='s' && !(verb.charAt(verb.length()-1)==vowel))
So this .....==vowel of course isn't the right syntax. I'd say this idea is quite basic and simple to convey in this way, so could someone tell me what is the right syntax for this?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 5 2009
Added on Jan 8 2009
10 comments
602 views