I have the following if-else branch in java.
if (str.equals("a")) { A;}
else if (str.equals("b")) { B;}
else if (str.equals("c")) { C;}
else if (str.length == 5) { D;}
else { E;}
how to modify this code into strategy pattern ?
See Question&Answers more detail:os