All Questions
1 question
0
votes
2
answers
374
views
How to refactor code to avoid multiple if-s [from interview]?
On interview I was asked the following question:
I have following method:
public void foo(SomeObject o){
if(o.matches(constant1)){
doSomething1();
}else if(o.matches(constant2)){
...