X8: seeColor

Write a function in Java that implements the following logic: Given a string, if the string begins with "red" or "blue" return that color string, otherwise return the empty string.

Your Answer:

x
 
1
public String seeColor(String str)
2
{
3
    
4
}
5
Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.