In those words that you specified, y is being used as a vowel. It is the only letter in the English language which can be either a vowel or a consonant. There are no words in the English language that have no vowels.