Is swich can take string parameter yes or no like

string s="Mo";
swich(s)
{
case "sa ":
break ;
case "jv":
break;
default :
break:
}

no.

this is what java.sun.com says:

A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer.

If you use static strings in your switch, then you may think to enumerate them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.