Skip to main content

All Questions

Filter by
Sorted by
Tagged with
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)){ ...
gstackoverflow's user avatar