Write a program in Java to count the total number of vowels and consonants in a String. The string can contain all the alphanumeric and other special characters as well. However, only the lowercase English alphabets are allowed in the String.
Write a program in Java to count the total number of vowels and consonants in a String. The string can contain all the alphanumeric and other special characters as well. However, only the lowercase English alphabets are allowed in the String.
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: easy
标签: interviewbit, java-programming, topic-specific, java
参考答案摘要
We just have to traverse the string. If we get any vowel (a,e,i,o,u), we increment the variable corresponding to the vowel count and if we get a consonant, we increment the variable corresponding to t...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。