Practical work on Strings

The best way to get familiar with the methods from the String class is to run the programs and follow the code while examining the output.

Substrings.java    illustrates   the substring class.

ReverseString.java  uses charAt method to manipulate individual characters of a string.

TestString.java       illustrates various methods,  follow it carefully while running it.

UserName.java    Uses the substring method to create a username from a name, surname, and class group.

Program to write

(a) Write a program which will allow the user to enter a string of characters, and will print out a message saying how many vowels it contains

hints:  You can use the charAt method to examine each character in the string.

          strname.length()

          will tell you the length of the string.