For my program I am trying to replace all the vowels in a word with asterisk. I have written the code but keep receiving an error in the line where I am trying to replace the letter. The error I receive is " cannot find symbol" can someone explain to me why I am receiving this error?
for(int index =0; index<=length;index++){
Character vowel = firstName.charAt(index);
if ((vowel == 'A') || (vowel == 'a') || (vowel == 'E') || (vowel == 'e') || (vowel == 'I') || (vowel == 'i')
|| (vowel == 'O') || (vowel == 'o') || (vowel == 'U') || (vowel == 'u')){
vowel = vowel.replace( vowel, '*'); // error received here
}
}