answersLogoWhite

0

Can you use strings in switch with case?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

No. (You could of tested it yourself.)

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you use strings in switch with case?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can select cases be used for testing strings as well as number?

Yes so long as the case of strings are static. For example switch(word) { case "Apple": break; case "Orange": break; } is acceptable string word1 = "Apple"; string word2 = "Orange"; switch(word) { case word1: break; case word2: break; } is not acceptable.


How can we use characters in the switch statements to select the cases java?

Switch statements in Java can only use integer values. This means that we can switch on char values (because chars are simply ints with a different output type), but we can not switch on Strings or any other objects. The following examples are both valid in Java. // switch 1 int x = 1; switch(x) { case 0: break; case 1: break; default: break; } // switch 2 char x = '1'; switch(x) { case '0': break; case '1': break; default: break; }


Convertion of upper case char in a string to lower case and vice versa?

You can use the methods toUpperCase & toLowerCase to convert Strings to any case you want.


What will do in case of electric fire?

switch off the main switch and use sand to put off the fire


What is the use of the default case in a switch case?

The default case in a switch statement will be activated if none of the other case values match. It is used exactly for this purpose - if nothing else matches in the switch then this one will always match.Without a default case value, if nothing matched in the switch then nothing will be done. Sometimes it is necessary to know that nothing matched.


What is the use of switch statement in java?

In java, a switch statement is used to simplify a long list of 'if' statements. A switch statement takes the form of:switch (variableName){case condition1; command1;case condition2; command2;...}


What type of strings would you typically use on an acoustic?

You would use nyloon strings.


What type of strings did jaco pastorius use?

bass strings


If a guitar is made for pretend play can you turn it into a real guitar?

You switch the strings.


Why do bathrooms have pull strings or switches outside?

To make it easier to use. I prefer a light switch on the outside of the bathroom because it makes it easier to find especially if I am in a hurry.


What kind of bass strings does mike d'antonio use?

Awesome strings


Will guitar players will refer to the strings they use by the gauge of the what string?

yeah if someone picked up my guitar and asked I'd say 13-56 strings (very thick) , its like shoe sizes in ways but in this case its preference.