From the course: Nail Your Java Interview
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Challenge: Counting characters with string manipulation - Java Tutorial
From the course: Nail Your Java Interview
Challenge: Counting characters with string manipulation
(upbeat music) - [Instructor] It's time for some more string manipulation practice. In this challenge, you'll create a program that finds the number of vowels and consonants in a given string. You'll create a method that takes a string input and prints out the number of vowels and the number of consonants in that string input. We can assume that the string will contain only letters and white space. As a reminder, the letters A, E, I, O, U, and Y are considered vowels. For this challenge, you might want to keep the toCharArray and charAt methods in mind. Here are some example test cases you should try. Feel free to test your algorithm with other strings as well. Good luck!
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Concatenate strings with different methods3m 20s
-
Normalize string input4m 13s
-
Access data from strings4m 44s
-
Apply string functions in technical interviews4m 35s
-
Understand string equality4m 2s
-
Challenge: Developing a palindrome checker1m 31s
-
Solution: Developing a palindrome checker2m 50s
-
Challenge: Counting characters with string manipulation51s
-
Solution: Counting characters with string manipulation4m 9s
-
-
-
-
-