Following code represents one of the requirements in which you could use Switch statement to work with String in Java.…