+ 1

how to make a case switch with String

switch case with String

15th Oct 2017, 5:21 PM
Brayan Pérez Ramos
Brayan Pérez Ramos - avatar
2 Respuestas
+ 10
// For Example : switch (your_string_var) { case "Hi": System.out.print("Hello"); break; default: System.out.print("Bye"); }
15th Oct 2017, 5:41 PM
Dev
Dev - avatar
+ 1
When you say "case", follow up by an actual String; for example, ... case "Hi": ....
15th Oct 2017, 5:27 PM
Quantallax