The Delphi Case Statement only supports ordinal types. So you cannot use strings directly .
Read moreWhich data type Cannot be used in switch Java?
The switch statement doesn’t accept arguments of type long, float, double,boolean or any object besides String .
Read moreCan we use contains in Java?
The contains() method in Java is used to search the substring in a given String . Returns: If the substring is found in the specified String, then it returns a true value; otherwise, it returns a false value.
Read more