Create a new project. Write a StringMethods class according to the attached spec
ID: 3637387 • Letter: C
Question
Create a new project. Write a StringMethods class according to the attached specification:Constructor Detail
StringMethods
public StringMethods()
Method Detail
isAllLetters
public static boolean isAllLetters(String s)
Method to determine if a string is all letters
Parameters:
s - the String to test
Returns:
true if all letters; false otherwise. An empty String is not all letters.
reverseName
public static String reverseName(String name)
Method to reverse the parts of a name
Parameters:
name - in firstname lastname format
Returns:
name in lastname,firstname format
Throws:
IllegalArgumentException - if name does not have firstname and lastname.
IllegalArgumentException - if the names are not all letters