Please don't be offended - it's nothing personal. People here are more inclined to be forthright than polite for polite' sake. It's the information content that counts. :)
Using = true
is wrong. That tries to assign the value true
, not test for it. To test for it you need ==
But what I'm telling you is that you don't need the == true
at all. It's a common beginner mistake to think every if test needs a logical operator (==, > etc). All it needs is a boolean expression, for instance a call to a method (like yours) that returns a boolean. Using the redundant == is a sign that the programmer didn't really understand boolean expressions - but that's usually just inexperience, not a character defect!
Bottom line: you just code
if (if (isVowel.isVowelValid(letter)) ...
your method returns a boolean, and that's all you need for an if test.